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 format for fortran 77

Status
Not open for further replies.

npbauman

Programmer
Oct 20, 2011
1
US
I have the following line in an seperate output file:

CR-EOMCC(2,3),A E= -452.5031405006

Now i want to read the CR-EOMCC(2,3),A part as a whole character string, but when i do so normally it only reads the "CR-EOMCC(2" and stops at the comma. I want it to read past the first two commas but stop at the first space. I don't want to specify a specific length of the character string because it sometimes changes in length, so i want it to be kinda general when reading.

My question is really how do i specify how many commas or spaces to ignore when reading. Also, I am doing this all in fortran 77.

Thank you
 
I would read the entire line into a character array kind of variable, then, you can take your time inspecting it and setting indices...when you know what part of it you want, then, you simply:

str = line(i:j)

is it clear?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top