主题:改写文件数据总是会多出来数据,请指教
程序如下(改写的值在之前的程序已经定义好)
* 改写数据
open(unit=fileid, file="part1.inp", status='old')
read(fileid,"(A80)",iostat=error) title
do while(title(1:9)/="*Elastic,")
read(fileid,"(A80)",iostat=error) title
end do
write(fileid,1050)e1,",",e2,",",e3,",",nu12,",",nu13,",",nu23,",",
& g12,",",g13
write(fileid,1100)g23,","
1050 format(e11.4,a1,e11.4,a1,e11.4,a1,e11.4,a1,e11.4,a1,e11.4,a1,
& e11.4,a1,e11.4)
1100 format(e11.4,a1)
close(fileid)
以下是part.inp(改写之前的)
*Elastic, type=ENGINEERING CONSTANTS
112980.7023818, 52716.7185248, 52716.7185248, 0.4500000, 0.4500000, 0.4500000, 28500.0000000, 28500.0000000
28500.0000000, 共九个数据
改写后的数据:
*Elastic, type=ENGINEERING CONSTANTS
[color=FF0000]0.1770E-04, 0.4744E-04, 0.2108E+05,-0.3731E+00, 0.4500E+00, 0.4500E+00, 0.2222E+01, 0.2850E+05[/color]
0.1770E-04, 0.4744E-04, 0.2108E+05,-0.3731E+00, 0.4500E+00, 0.4500E+00, 0.2222E+01, 0.2850E+05
0.2850E+05,
改写后的数据没错,但红色字体的数据时多出来的,怎么回事啊,请各位大侠指教啊
* 改写数据
open(unit=fileid, file="part1.inp", status='old')
read(fileid,"(A80)",iostat=error) title
do while(title(1:9)/="*Elastic,")
read(fileid,"(A80)",iostat=error) title
end do
write(fileid,1050)e1,",",e2,",",e3,",",nu12,",",nu13,",",nu23,",",
& g12,",",g13
write(fileid,1100)g23,","
1050 format(e11.4,a1,e11.4,a1,e11.4,a1,e11.4,a1,e11.4,a1,e11.4,a1,
& e11.4,a1,e11.4)
1100 format(e11.4,a1)
close(fileid)
以下是part.inp(改写之前的)
*Elastic, type=ENGINEERING CONSTANTS
112980.7023818, 52716.7185248, 52716.7185248, 0.4500000, 0.4500000, 0.4500000, 28500.0000000, 28500.0000000
28500.0000000, 共九个数据
改写后的数据:
*Elastic, type=ENGINEERING CONSTANTS
[color=FF0000]0.1770E-04, 0.4744E-04, 0.2108E+05,-0.3731E+00, 0.4500E+00, 0.4500E+00, 0.2222E+01, 0.2850E+05[/color]
0.1770E-04, 0.4744E-04, 0.2108E+05,-0.3731E+00, 0.4500E+00, 0.4500E+00, 0.2222E+01, 0.2850E+05
0.2850E+05,
改写后的数据没错,但红色字体的数据时多出来的,怎么回事啊,请各位大侠指教啊