
reading strings with embedded "/" characters
I have text files with lines such as
2/25/2001 12.2 10.4
12/2/2000 2.0 3.0
I would like to read strings from each line and then read the
numerical data from each string. The problem is that
character (len=*), parameter :: input_line="2/25/2001 12.2 10.4"
character (len=100)
read (input_line,*) s1,s2,s3
will not read "2/25/2001" into s1, since "/" is recognized as a delimiter.
What I do is replace the "/" characters with some other character
such as "?", read the strings, and then replace "?" with "/".
This is ugly. Is there a way to tell the compiler not to treat "/" as a
delimiter?