- #1
SAMANDEEP
- 1
- 0
In my Fortran program, I want to read data from various files whose size I do not know in prior. The input files which I am trying to read may contain different number of entries. If I have same and known number of entries in all files (say 386), I can use something like:
open(unit=1,file='mu.dat',status='old')
open(unit=2,file='md.dat',status='old')
open(unit=3,file='ms.dat',status='old')
do i=1,386,1
read(1,*)mu(i)
read(2,*)md(i)
Can someone please help me in doing it if I don't know the number of rows in my data files in prior?
Thanks,
Saman.
open(unit=1,file='mu.dat',status='old')
open(unit=2,file='md.dat',status='old')
open(unit=3,file='ms.dat',status='old')
do i=1,386,1
read(1,*)mu(i)
read(2,*)md(i)
Can someone please help me in doing it if I don't know the number of rows in my data files in prior?
Thanks,
Saman.