I/O reading formated files




Hi,

I've got a problem reading a data file. The file contains four numbers
in exponetial form par line (as illustrated below)

2.443526e-01 2.166543e-02 4.173232e-01 1.733755e+05
....

I read those lines with:

READ( 2, FMT='(E12.6, 3E13.6)',IOSTAT=ios) a,b,c,d

That's not that difficult, but if one of these numbers appears to be
negative the leading minus sign does not fit with my format

e.g.

2.443526e-01 2.166543e-02 4.173232e-01 1.733755e+05
....
2.467348e-01 -6.730524e-04 4.012660e-01 2.702110e+05
....
2.460509e-01 1.539250e-04 4.087237e-01 1.461959e+05

How do I manage to read all the lines of my data file?

TIA

Julian

.



Relevant Pages

  • Re: I/O reading formated files
    ... I've got a problem reading a data file. ... in exponetial form par line ... How do I manage to read all the lines of my data file? ... It looks as if the file was not written by a similar Fortran format. ...
    (comp.lang.fortran)
  • Re: Using dates during mail merge
    ... The other thing that might be causing problems here is that, regardless of how the DATE field nested in the ASK field is formatted, the user will need to enter the date in the format set up in their regional options (or any other format where the month and day are not ambiguous. ... I was however remiss in not changing the field name from that in my data file as this added some unwelcome confusion:( ... You included 'MyDate' and 'Date2' in your ...
    (microsoft.public.word.mailmerge.fields)
  • Re: 03 versus 97/2002 version
    ... The new format is not backwards compatible so proceed at your own risk. ... File->new-outlook data file. ... dragging to the new calendar FOLDER works best. ...
    (microsoft.public.outlook)
  • Re: Using dates during mail merge
    ... If you have some other format but January eg january or JANUARY you will ... Word MVP web site http://word.mvps.org ... that in my data file as this added some unwelcome confusion:(-- ... You included 'MyDate' and 'Date2' in your ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Help needed for perl rookie
    ... > Newsgroups: comp.lang.perl.misc ... However I am stuck trying to modify the ... >> example #2 and need this section of code to work with the new format. ... It reads the data file that is in this format: ...
    (comp.lang.perl.misc)