Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

READ part of a file

Status
Not open for further replies.

blasco

Programmer
Jul 22, 2011
4
IE
Hello.

I use fortran 90 and I need to read from a file a certain number of data that appear after a certain word.

as instance i have a file like

[anything]

ZXX
8
12.3 12.2 0.023 23.222 12
12.23 12.2 0.023 23.222 12
12.3 12.2 0.023 23.222 12
12.3 12.2 0.023 23.222 12
12.3 12.2 0.023 23.222 12
12.3 12.2 0.023 23.222 12
12.3 12.2 0.023 23.222 12
12.3 12.2 0.023 23.222 12

[something more]

and I will need to put data in variables according with the last two characters of the word. (they may be any combination of x,y)

any sugestion?

 
Dear blasco

I do not quite understang your problem. Please explain it better. What is the "word" your refer to ?

Best wishes
gullipe
 
Hold up? It is summer - everyone is on holiday!

Let me see if I understand the problem. You want the program to

1) read the data file until it comes to a letter sequence (in this case ZXX)
2) read the number of entries (in this case 8)
3) read in specified columns of the data according to the letter sequence.

It is the third part that isn't very clear.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top