本帖最后由 楚香饭 于 2015-3-8 22:20 编辑
[Fortran] 纯文本查看 复制代码 Program www_fcode_cn
Implicit None
integer :: i
character(len=2) :: time(4)
character(len=10) :: date1(4) , date(4) , vel(4) , angl(4)
Open(12,File='t.txt')
Do i = 1 , 4
read(12,'(T7,A2)',advance='no') time(i)
read( 12 , * ) date1(i),date(i),vel(i),angl(i)
write(*,*) time(i) , date1(i),date(i),vel(i),angl(i)
End Do
End Program www_fcode_cn
这个代码读出的结果是:
1-01 00:00:00 3.800000 12.00000
1-01 00:10:00 3.900000 12.00000
1-01 00:20:00 4.000000 12.00000
1-01 00:30:00 4.100000 9.000000
不知是否符合你的想法?? |