FORTRAN Program for searching files
FORTRAN Program for searching files
(OP)
Can any one help with some examples of programs coded to open text files, search them for some criteria, extract that data and dump into another text file?
Thanks!
Thanks!
Regards,
Qshake
Eng-Tips Forums:Real Solutions for Real Problems Really Quick.
RE: FORTRAN Program for searching files
There's an old general-purpose file parser program called FileParse written by Dead Pig Software. They apparently ceased operation in 2000, but their program is still floating around in cyberspace. It's a bit touchy, but will parse large text files.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: FORTRAN Program for searching files
Admittedly I'm past my years of experience with this, hence my reason for posting, but I'd like to learn and if that means new language that's fine, just give me a tip and I'll track it down.
Regards,
![[pipe] pipe](https://www.tipmaster.com/images/pipe.gif)
Qshake
Eng-Tips Forums:Real Solutions for Real Problems Really Quick.
RE: FORTRAN Program for searching files
I was just trying to point out that writing your own parser seems hardly necessary if someone already has one written.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: FORTRAN Program for searching files
Attached is a simple program source code to search a file or group of files for a particular character string. The input filename to be searched can include wild cards to enable multiple files to be scanned. Output is either to a file or the terminal.
RE: FORTRAN Program for searching files
Q
Regards,
![[pipe] pipe](https://www.tipmaster.com/images/pipe.gif)
Qshake
Eng-Tips Forums:Real Solutions for Real Problems Really Quick.
RE: FORTRAN Program for searching files
Dan
www.dtware.com
CHARACTER(132) :: inFname = 'MyInputFile'
CHARACTER(132) :: outFname = 'MyOutputFile'
CHARACTER(132) :: str ! character buffer
INTEGER :: i, n
OPEN(12,file=inFname)
OPEN(13,file=outFname)
n = 0
DO
Read(1,'(a)',end=10) str
i = Index(str,'Member Area')
IF( i/=0 )THEN
n = n + 1
Read(str(i+11:),'(f100.0)') area
Write(13,'(a,i5,f12.4)') 'Member #', n, area
END IF
END DO
10 Continue
CLOSE(12)
CLOSE(13)
END