我有这样的文件
1980 01 23
1982 04 30
1983 05 22
1984
1985 02 11
我尝试使用格式“(3I4)”读取数据
implicit none
integer, parameter :: FUnitIn = 10
character(len=255) :: FNameIn = "./test.txt"
integer :: FStatOpen, FStatRead
integer :: yyyy, mm, dd
open ( unit = FUnitIn, &
file = trim(FNameIn), &
access = "sequential", &
form = "formatted", &
status = "old", &
iostat = FStatOpen)
if (FStatOpen /= 0) then ! ERROR
stop
end if
do
read (FUnitIn, "(3I4)", iostat=FStatRead) yyyy, mm, dd
if (FStatRead /= 0) then
exit
else
write (6, "(3I4)") yyyy, mm, dd
end if
end do
我得到了三个零的空白行。是否有任何选项来处理空白输入?