starlite79
Technical User
Hi,
First question: can I use awk in a Fortran program?
Second: I'd like to use substr to get the part of a file itself (not the contents of the file). For example, I have many files in a directory with the same prefix and a YYMMDD.dat suffix. I want to pick out the YY part of the filename and assign it to a variable, say yr.
Would it look something like (if I'm in the proper directory):
yr = "awk ' { print substr(FILENAME, 18, 2) } '" ?
There are many filenames I'd like to do for this process.
Am I asking too much of awk and Fortran?
First question: can I use awk in a Fortran program?
Second: I'd like to use substr to get the part of a file itself (not the contents of the file). For example, I have many files in a directory with the same prefix and a YYMMDD.dat suffix. I want to pick out the YY part of the filename and assign it to a variable, say yr.
Would it look something like (if I'm in the proper directory):
yr = "awk ' { print substr(FILENAME, 18, 2) } '" ?
There are many filenames I'd like to do for this process.
Am I asking too much of awk and Fortran?