- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am reading a line from a file and writing it to another file. The sample code is given below.
CHARACTER*80 CURR_LINE
OPEN(3, FILE='input.inp',STATUS='OLD')
OPEN(4, FILE='output.out', STATUS = 'NEW')
READ(3,'(A80)') CURR_LINE
WRITE(4,'(A80)') CURR_LINE
WRITE(4,'(A80)') CURR_LINE
CLOSE(3)
CLOSE(4)
The problem is that I am getting extra blank spaces at the end of the line in the output file. For example if the input file line is 5 characters long, the code fills the output line from 6th character to 80th character with blank spaces. This creates a lotof problems for me in another software. Can someone tell me how I can get rid of the empty characters at the end of the line. I am using CVF 66A.
Thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WRITE(4,'(A)') TRIM(CURR_LINE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help. I will try this.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page