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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file length in FORTRAN

Status
Not open for further replies.

bhussin74

Technical User
Feb 6, 2004
7
GB
Hi guys...

How we can get a file length in FORTRAN.

Assume we have a file data
file1.dat
12
14
3
4
67
89
54
47

How can we get the length of file1.dat
 
Do you mean file size or number of numbers or number of lines in the file?
 
What i mean is in that file1.dat there are 8 lines data, how i'm going to get it in FORTRAN.

 
It is not possible to find out how many lines of data there are when you open a file. You could perform reads to count it and then rewind and re-read the data or if you are on unix and put the result of "wc -l file1.dat" into a file, you could read that file to find out how many lines are in file1.dat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top