reading a large number of files
reading a large number of files
(OP)
I have to read and extract data from a large number of files:
file1.dat
file2.dat
file3.dat
.........
file100.dat
Is there a fast way of reading all these files one at a time?
My simple idea is to write all the filenames in a text file from which i will read a filename at a time. If anyone knows a faster solution im glad to hear it.
Thanx
file1.dat
file2.dat
file3.dat
.........
file100.dat
Is there a fast way of reading all these files one at a time?
My simple idea is to write all the filenames in a text file from which i will read a filename at a time. If anyone knows a faster solution im glad to hear it.
Thanx
RE: reading a large number of files
As for reading the file itself, the preference would be binary format, since that goes much faster than text.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: reading a large number of files
If i have:
GR01.dat
GR07.dat
FR01.dat
FR02.dat
IT01.dat
IT06.dat
........
Is there a way fortan could read one by one all these...
if i dont want to write all the filenames in a .txt file?
Thanx!
RE: reading a large number of files
If so, have your program initiate a directory operation to list the files into some new file (of a different extension). Once this file has been created, your program can open it, then read the .dat file names one by one and open them for you to extract the stuff you want.
In good ol' DOS, the directory operation would have been
DIR *.DAT /B > FILES.LST
RE: reading a large number of files
RE: reading a large number of files
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: reading a large number of files
(One, not l or L)
In most dialects.
- Steve
RE: reading a large number of files
ls -1 *.dat > files.txt