- #1
Carl Loomis-Anderson
- 6
- 1
So I am doing a chemical simulation of titans atmosphere and I have potentially 1000 data files to sort through to retrieve concentration values written in Double format. The issue is that each chemical has its own line with well over 80 columns (1993 currently, though it is subject to increase). I was wondering how I could copy a line from each file and paste it into a single output file. This is the current unfinished code I have.
Fortran:
CHARACTER(len=12) :: FN
c this is the number of runs/files. The character string has
c to edited for each chemical it tests
N=5 !--arbitrary number of files, change for number runs
CHARACTER*4 :: chem
chem = C6H6
INT chemnum
chemnum = **** !this is the number associated with the chemical
OPEN(2,FILE=(chem+".DAT"), STATUS="NEW")
DO I=1,N
WRITE(FN,10)I
WRITE(6,*)FN
OPEN(1,FILE=FN)
DO j=1,(chemnum-1) ! cycles to the appropriate line
READ(1,*)
END DO
Read(1,*)
CLOSE(1)
END DO
CLOSE(2) 10 FORMAT('plot',I2.2,'.DAT')