Search for a File and get the name
Search for a File and get the name
(OP)
Hi everybody,
I am new Fortran user. I have written a Subroutine which opens an Input file in the current work directory and reads some data from this file. The Problem is that the Name of the input file changes each time but the extension is always .inp. Is is possible in Fortran 77 to get the file name automatically and open the file without changing the name each time in READ statement?
Any answer is really appreciated.
Regards
Ehsan
I am new Fortran user. I have written a Subroutine which opens an Input file in the current work directory and reads some data from this file. The Problem is that the Name of the input file changes each time but the extension is always .inp. Is is possible in Fortran 77 to get the file name automatically and open the file without changing the name each time in READ statement?
Any answer is really appreciated.
Regards
Ehsan





RE: Search for a File and get the name
CODE --> processdata.f
program main character(len=32):: arg integer:: numarg ! print arguments from the command line numarg = command_argument_count() print *, 'Num arg ', numarg do nn = 1, numarg call get_command_argument(nn, arg) print*, 'arg ', nn, ' = ', arg end do endCODE --> run.bat
RE: Search for a File and get the name
RE: Search for a File and get the name
Ehsan
RE: Search for a File and get the name