Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29375 Discussions

Reading lines in text - character /

imeca
Beginner
643 Views

Hello,

Propbably, my question will seem to somepeople trivial, but i am not a professionnal. Sorry for that.

My problem is when i use the "read" function to read a line in a text file, the resulting line wil stop at the character "/".

For example if the line i want to read is 'test1/test2", the result will be "test1", as if the remaining part was not here.

With this problem, i can not read a line which contains date formats. for example when the line in the text contains 23/11//2008, the read function will not complete the whole date, it will stop at 23. Consequently, i will not be able to handle date manipulations.

Can anybody help me in this issue.

Thanks in advance.

0 Kudos
1 Reply
TimP
Honored Contributor III
643 Views

I guess maybe you tried only list-directed read. If you know exact column numbers for the data, you should be able to read them with I formats. Otherwise, you may have to read an entire line as a character string, and search for the expected fields.

0 Kudos
Reply