主题:[原创]fortran 如何读取这个文件
这个是文件
0 1 2 3 4 5 6 7 8
1 2.4202093E+06
2 0.0000000E+00 7.4389397E+04
3 0.0000000E+00 0.0000000E+00 7.4389397E+04
4 0.0000000E+00 0.0000000E+00 0.0000000E+00 5.3905496E+07
5 0.0000000E+00 0.0000000E+00 -4.0957871E+06 0.0000000E+00 2.9184558E+08
6 0.0000000E+00 4.0957871E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00 2.9184558E+08
7 -2.4202093E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 2.4202093E+06
8 0.0000000E+00 -7.4389396E+04 0.0000000E+00 0.0000000E+00 0.0000000E+00 -4.0957871E+06 0.0000000E+00 7.4389397E+04
9 0.0000000E+00 0.0000000E+00 -7.4389396E+04 0.0000000E+00 4.0957871E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00
10 0.0000000E+00 0.0000000E+00 0.0000000E+00 -5.3905496E+07 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
11 0.0000000E+00 0.0000000E+00 -3.3431525E+06 0.0000000E+00 1.1773313E+08 0.0000000E+00 0.0000000E+00 0.0000000E+00
12 0.0000000E+00 3.3431525E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00 1.1773313E+08 0.0000000E+00 -3.3431525E+06
13 1.2585176E-12 2.0708573E+03 -2.5791880E+03 -1.4029489E-05 1.3995450E+05 1.1237095E+05 -1.2585177E-12 -2.0708573E+03
14 -2.4842519E-12 2.5791880E+03 2.0708573E+03 -8.0930180E-05 -1.1237095E+05 1.3995450E+05 2.4842520E-12 -2.5791880E+03
15 -4.5520386E-11 2.0268283E-06 1.1203054E-06 2.9717002E+05 -6.0788678E-05 1.0997642E-04 4.5520388E-11 -2.0268283E-06
16 -9.7475813E+03 2.4303875E-09 1.1721444E-09 -1.2216595E-07 -6.6879492E-08 1.3879689E-07 9.7475817E+03 -2.4303876E-09
17 9.5722477E-09 2.5098067E+04 -4.6261888E+04 4.3484367E-06 2.6743511E+06 1.4508929E+06 -9.5722478E-09 -2.5098067E+04
18 -1.6394618E-08 -4.6261888E+04 -2.5098067E+04 -6.4262816E-05 1.4508929E+06 -2.6743511E+06 1.6394619E-08 4.6261889E+04
19 -1.8735980E+05 1.5255002E-04 4.4192003E-05 4.2412075E-04 -3.0282144E-03 9.8802475E-03 1.8735980E+05 -1.5255002E-04
20 -3.1423644E-04 -1.5973329E+04 2.0276090E+04 -1.3519023E-03 -1.2493893E+06 -9.8425820E+05 3.1423644E-04 1.5973330E+04
21 6.7190953E-04 2.0276090E+04 1.5973330E+04 2.0819363E-03 -9.8425822E+05 1.2493893E+06 -6.7190953E-04 -2.0276090E+04
22 3.1439582E-04 6.7442105E+04 -3.4322022E+04 -1.6844542E-03 2.5332022E+06 4.9776929E+06 -3.1439582E-04 -6.7442105E+04
23 6.9161327E-04 3.4322022E+04 6.7442105E+04 3.5303111E-04 -4.9776929E+06 2.5332022E+06 -6.9161327E-04 -3.4322022E+04
24 1.0685863E+06 -4.5934980E-04 -9.4806272E-04 -7.8728804E-03 7.1773106E-02 -3.2075519E-02 -1.0685863E+06 4.5934980E-04
25 2.1861492E-02 3.4146991E+03 3.6738248E+04 -2.1577478E-02 -2.8050848E+06 2.6072338E+05 -2.1861492E-02 -3.4146991E+03
26 -9.3384198E-01 3.6738354E+04 -3.4147263E+03 -5.0030750E+00 2.6072601E+05 2.8050915E+06 9.3384198E-01 -3.6738354E+04
27 1.3243075E-03 -7.6462851E-05 3.4547071E-05 -1.6273777E-05 7.7819315E-04 -1.9210301E-03 -1.3243075E-03 7.6462850E-05
28 5.5717495E-03 3.1417487E-04 -1.3523136E-04 1.9374718E+06 8.7719691E-03 2.5551483E-02 -5.5717495E-03 -3.1417487E-04
我想要一个如:k(1,1)=2.4202093E+06
k(1,2)=0
没有数值就为0 一直读完 。
0 1 2 3 4 5 6 7 8
1 2.4202093E+06
2 0.0000000E+00 7.4389397E+04
3 0.0000000E+00 0.0000000E+00 7.4389397E+04
4 0.0000000E+00 0.0000000E+00 0.0000000E+00 5.3905496E+07
5 0.0000000E+00 0.0000000E+00 -4.0957871E+06 0.0000000E+00 2.9184558E+08
6 0.0000000E+00 4.0957871E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00 2.9184558E+08
7 -2.4202093E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 2.4202093E+06
8 0.0000000E+00 -7.4389396E+04 0.0000000E+00 0.0000000E+00 0.0000000E+00 -4.0957871E+06 0.0000000E+00 7.4389397E+04
9 0.0000000E+00 0.0000000E+00 -7.4389396E+04 0.0000000E+00 4.0957871E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00
10 0.0000000E+00 0.0000000E+00 0.0000000E+00 -5.3905496E+07 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
11 0.0000000E+00 0.0000000E+00 -3.3431525E+06 0.0000000E+00 1.1773313E+08 0.0000000E+00 0.0000000E+00 0.0000000E+00
12 0.0000000E+00 3.3431525E+06 0.0000000E+00 0.0000000E+00 0.0000000E+00 1.1773313E+08 0.0000000E+00 -3.3431525E+06
13 1.2585176E-12 2.0708573E+03 -2.5791880E+03 -1.4029489E-05 1.3995450E+05 1.1237095E+05 -1.2585177E-12 -2.0708573E+03
14 -2.4842519E-12 2.5791880E+03 2.0708573E+03 -8.0930180E-05 -1.1237095E+05 1.3995450E+05 2.4842520E-12 -2.5791880E+03
15 -4.5520386E-11 2.0268283E-06 1.1203054E-06 2.9717002E+05 -6.0788678E-05 1.0997642E-04 4.5520388E-11 -2.0268283E-06
16 -9.7475813E+03 2.4303875E-09 1.1721444E-09 -1.2216595E-07 -6.6879492E-08 1.3879689E-07 9.7475817E+03 -2.4303876E-09
17 9.5722477E-09 2.5098067E+04 -4.6261888E+04 4.3484367E-06 2.6743511E+06 1.4508929E+06 -9.5722478E-09 -2.5098067E+04
18 -1.6394618E-08 -4.6261888E+04 -2.5098067E+04 -6.4262816E-05 1.4508929E+06 -2.6743511E+06 1.6394619E-08 4.6261889E+04
19 -1.8735980E+05 1.5255002E-04 4.4192003E-05 4.2412075E-04 -3.0282144E-03 9.8802475E-03 1.8735980E+05 -1.5255002E-04
20 -3.1423644E-04 -1.5973329E+04 2.0276090E+04 -1.3519023E-03 -1.2493893E+06 -9.8425820E+05 3.1423644E-04 1.5973330E+04
21 6.7190953E-04 2.0276090E+04 1.5973330E+04 2.0819363E-03 -9.8425822E+05 1.2493893E+06 -6.7190953E-04 -2.0276090E+04
22 3.1439582E-04 6.7442105E+04 -3.4322022E+04 -1.6844542E-03 2.5332022E+06 4.9776929E+06 -3.1439582E-04 -6.7442105E+04
23 6.9161327E-04 3.4322022E+04 6.7442105E+04 3.5303111E-04 -4.9776929E+06 2.5332022E+06 -6.9161327E-04 -3.4322022E+04
24 1.0685863E+06 -4.5934980E-04 -9.4806272E-04 -7.8728804E-03 7.1773106E-02 -3.2075519E-02 -1.0685863E+06 4.5934980E-04
25 2.1861492E-02 3.4146991E+03 3.6738248E+04 -2.1577478E-02 -2.8050848E+06 2.6072338E+05 -2.1861492E-02 -3.4146991E+03
26 -9.3384198E-01 3.6738354E+04 -3.4147263E+03 -5.0030750E+00 2.6072601E+05 2.8050915E+06 9.3384198E-01 -3.6738354E+04
27 1.3243075E-03 -7.6462851E-05 3.4547071E-05 -1.6273777E-05 7.7819315E-04 -1.9210301E-03 -1.3243075E-03 7.6462850E-05
28 5.5717495E-03 3.1417487E-04 -1.3523136E-04 1.9374718E+06 8.7719691E-03 2.5551483E-02 -5.5717495E-03 -3.1417487E-04
我想要一个如:k(1,1)=2.4202093E+06
k(1,2)=0
没有数值就为0 一直读完 。