matthewkmk
Programmer
how to read the data on the same line
e.g.
if i want to read the number after Mary once I have found Mary in the data file. Because it will read the next line after it found Mary if I want to read the number after Mary.
open(13,FILE='ff.dat')
1010 continue
read(13,1001,end=1011) ee
if (ee(1:4) .eq. 'Mary') then
read(13,1002,advance='no',end=1011) a
endif
goto 1010
1011 close(13)
Data:
Mary 100
John 200
David 400
Mary 300
Thx very much.
e.g.
if i want to read the number after Mary once I have found Mary in the data file. Because it will read the next line after it found Mary if I want to read the number after Mary.
open(13,FILE='ff.dat')
1010 continue
read(13,1001,end=1011) ee
if (ee(1:4) .eq. 'Mary') then
read(13,1002,advance='no',end=1011) a
endif
goto 1010
1011 close(13)
Data:
Mary 100
John 200
David 400
Mary 300
Thx very much.