[Fortran] 纯文本查看 复制代码
program main
character(len=20) :: filedir1,filedirN1,filedir2,filedirN2,filedir3,filedirN3,filedir4,filedirN4,filedir5,filedirN5,filedir6,filedirN6,filedir7,filedirN7
character(len=17) :: filename
character(len=100) :: line
filename='APMG3490.19D'
filedir1='D:\CIDE1\2019\'
filedirN1='D:\CIDEN1\2019\'
filedir2 = 'D:\CIDE2\2019\'
filedirN2 = 'D:\CIDEN2\2019\'
filedir3='D:\CIDE3\2019\'
filedirN3 = 'D:\CIDEN3\2019\'
filedir4='D:\CIDE4\2019\'
filedirN4 = 'D:\CIDEN4\2019\'
filedir5='D:\CIDE5\2019\'
filedirN5 = 'D:\CIDEN5\2019 '
filedir6='D:\ CIDE6\2019\'
filedirN6 = 'D:\CIDEN6\2019\'
filedir7='D:\CIDE\2019\'
filedirN7 = 'D:\CIDEN\2019\'
OPEN(20,FILE=trim(adjustl(filedirN1))//trim(adjustl(filenam)),position='append' )
OPEN(30,FILE=adjustl(trim(filedirN2))//adjustl(trim(filenam)))
OPEN(40,FILE=adjustl(trim(filedirN3))//adjustl(trim(filenam)))
OPEN(50,FILE=adjustl(trim(filedirN4))//adjustl(trim(filenam)))
OPEN(60,FILE=adjustl(trim(filedirN5))//adjustl(trim(filenam)))
OPEN(70,FILE=adjustl(trim(filedirN6))//adjustl(trim(filenam)))
!DO WHILE(.NOT.EOF(20))
! read(20,*)line
!enddo
DO WHILE(.NOT.EOF(30))
read(30,*)line
write(20)line
enddo
DO WHILE(.NOT.EOF(40))
read(40,*)line
write(20)line
enddo
DO WHILE(.NOT.EOF(50))
read(50,*)line
write(20)line
enddo
DO WHILE(.NOT.EOF(60))
read(60,*)line
write(20)line
enddo
close(30)
close(40)
close(50)
close(60)
close(70)
end