Hi,
I have a large data stored in a text file. The text file contains one REAL value per line.
I know the line number at which I have to read the data.
For example line number 20000. Is there any way to read the value directly at the line 2000 instead of reading from the starting of the file?

Thanks in advance!

You need to open the file using direct access

REAL*4 r
Open (unit=21, file='mydatafile.dat', access='DIRECT')
Read(21,900,20000) r
900 format(F8.6)

HTH
Erik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.