FORTRAN求解
问题描述:
FORTRAN求解
Fortran怎样读取.txt文件里的文本行,我想得到的是wall1后面的298093567,O(∩_∩)
"Surface Integral Report"
Average of Surface Vertex Values
Static Temperature (k)
-------------------------------- --------------------
wall1 298.93567
wall2 298.48569
wall3 298.08218
wall4 310.13739
outlet 296.23862
default-interior 300.79886
---------------- --------------------
Net 300.81006
答
存成这种格式太不便
跳读吧,得数好,不通用
open (10, file='data.txt')
do i = 1, 11
if (i .lt. 6) then
read (10, *)
cycle
endif
read (10, '(a44, f)') s, a
write (*, '(f)') a
enddo
close (10)
end