File Reading

From: David Young (davids9999_at_yahoo.com)
Date: 07/28/04


Date: Wed, 28 Jul 2004 14:31:43 -0500

Hi, All!

This might be a newbie question but I don't know the solution. So
forgive me if it is too simple.

I am planning to read a file in Fortran (CVF 6.6), which contains both
text and numbers. It is looks like this:
# text 1
12 34 56
# text 2
        # text 3
12 34
The number records in each line are known but the positions of the text,
which is supposed to be the comments, are not. I hope I made the problem
clear.
What I want to do is exam each line before I read in, if it begins with
"#", I will ignore it. Otherwise, I will re-read the line and get the
numbers out.
I know this can be done easily in c but I could not find a simple
solution using Fortran. I would really appreciate if somebody could
offer me a solution.

Thanks!


Quantcast