- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My compiler is: Compact Fortran 6.6
I am trying to read data from a file which MAY or MAY NOT include
Tabs. The source below works in Absoft fortran but fails in Compact Fortran with "input conversion error"
SOURCE CODE:
open(unit=11,name='junk.bdf',type='old')
open(unit=21,name='junk.out',type='new')
100 continue
read(11,20) id,icp,x1,x2,x3,icd
20 format(bn,8x,i8,i8,f8.3,f8.3,f8.3,i8)
write(21,21) id,icp,x1,x2,x3,icd
21 format('GRID',4x,i8,i8,3f8.4,i8)
go to 100
stop
end
DATA FILE: (line 3 includes TABS and fails)
GRID 101 3 100. 3. 0.0 2
GRID 102 3 100. 4. 0.0 2
GRID 103 3 100. 5. 0.0 2
I am trying to read data from a file which MAY or MAY NOT include
Tabs. The source below works in Absoft fortran but fails in Compact Fortran with "input conversion error"
SOURCE CODE:
open(unit=11,name='junk.bdf',type='old')
open(unit=21,name='junk.out',type='new')
100 continue
read(11,20) id,icp,x1,x2,x3,icd
20 format(bn,8x,i8,i8,f8.3,f8.3,f8.3,i8)
write(21,21) id,icp,x1,x2,x3,icd
21 format('GRID',4x,i8,i8,3f8.4,i8)
go to 100
stop
end
DATA FILE: (line 3 includes TABS and fails)
GRID 101 3 100. 3. 0.0 2
GRID 102 3 100. 4. 0.0 2
GRID 103 3 100. 5. 0.0 2
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I set it up to run the file through the expand program before Fortran sees it. This may not be to your taste, but you don't give any indication what constraints you intend to put on the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
tim18-
Thanks for the reply. You mention the "expand" program.
What is that? How can I access it?
The files I want to read may be quite large. Tabs may or may not be sprinkled thoughout the data.
Thanks.
Thanks for the reply. You mention the "expand" program.
What is that? How can I access it?
The files I want to read may be quite large. Tabs may or may not be sprinkled thoughout the data.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would use cygwin expand. http://www.cygwin.com/ Don't recall which installation option brings it in (textutils?), but that site tells you how to look it up. Evidently, the same program is included in MKS toolkit, and maybe in SFU.
I haven't looked to see whether it would be easy to build the official expand source with a lowest-common-denominator C compiler environment. No doubt, it could be done in Fortran too, by reading the line as a CHARACTER string, and expanding the string. I'm sure I haven't covered all the possibilities, some of which must have occurred to you.
I haven't looked to see whether it would be easy to build the official expand source with a lowest-common-denominator C compiler environment. No doubt, it could be done in Fortran too, by reading the line as a CHARACTER string, and expanding the string. I'm sure I haven't covered all the possibilities, some of which must have occurred to you.

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