[Fortran] 纯文本查看 复制代码 program test
character(80) sLine
logical IsHFL
integer i
open(11,file='1.txt')
open(12,file='2.txt')
do
read(11,'(a)',iostat=i) sLine
if(i/=0) exit
if(len_trim(sLine)==3) then
if(sline=='HFL') then
IsHFL = .true.
else
IsHFL = .false.
end if
end if
if(IsHFL) write(12,'(a)') sLine
end do
close(11)
close(12)
end |