4
我有一個巨大的文件讀取其結構是:閱讀格式90
[...]
(0,0,0,0,0): 5.00634e-33, 5.59393e-33, 6.24691e-33, 7.29338e-33,
(0,0,0,0,4): 7.77607e-33, 8.95879e-33, 9.65316e-33, 1.07434e-32,
(0,0,0,0,8): 1.20824e-32, 1.34983e-32, 1.49877e-32, 1.73061e-32,
(0,0,0,0,12): 1.919e-32, 2.15391e-32, 2.3996e-32, 2.67899e-32,
[...]
我感興趣後讀取值「:」,這format
,我應該讀語句中使用,如果我使用Fortran90?
我試着
read(1,'("(",I6,",",I6,",",I6,",",I6,",",I6,"):",F10.4,F10.4,F10.4,F10.4)')idx1,idx2,idx3,idx4,idx5,dummy1,dummy2,dummy3,dummy4
但我得到了一個forrtl: severe (64): input conversion error
除了M.S.B的解決方案。你可以將整行讀入一個字符串,用空格替換任何'(',')'和':',然後使用列表控制的IO讀取結果字符串。 –