[Fortran] 纯文本查看 复制代码 program watersave
implicit none
character*5 filename
integer :: i,k,flag
integer :: a1, a2, a3 , a5, a6, a7, a8, a9, a10, a11, a12,a13
real*8 :: a4
open(10, file = "D:\a\stations.txt")
do i = 1 ,703
read(10, *) filename
open(11, file = "D:\a\"//filename//".txt")
do k = 1,19358
read(11, *)a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13
if(a10 == 32766) then
flag=1
endif
end do
if(flag == 1) then
close(11, status = "delete")
else
close(11, status = "keep")
endif
end do
end
我这是批量读取703个文件,19358行,我想把a10列等于32766的文件删掉,然后跟人请教一下这样写代码,但是这样的话就把所有的文件都删掉了。请指点一下怎么改正一下好呢?
|