- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have a file like this:
It should have at least one space between the second and third data. But the number(3rd one) is too large.
I'd like to detect this kind of file from several files, if this error happens.
I used
read(....,IOSTAT=ios) a,b,c
I print ios values for every file including the above example.
I find every ios is 0, i.e. success reading.
How to detect the above file as a failed one?
If I neglect "IOSTAT=ios" in READ, then I get "list-directed i/o syntax error...."
Thanks
Mike
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mike,
The "usual" way to do this is to read the data into a character string [read (lu,'(a)') string] and parsethe stringyourself, that way you have full control over error handling etc.
Les
The "usual" way to do this is to read the data into a character string [read (lu,'(a)') string] and parsethe stringyourself, that way you have full control over error handling etc.
Les

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