reading data from txt file in fortran

前端 未结 6 1325
渐次进展
渐次进展 2020-12-17 23:53

I am writing a FORTRAN program that reads data from a text file and writing it to the console. the data file looks something like this

1234567890123456 12345         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 00:06

    I used fixed format because the editing and inspecting of input files having fixed column structure is easier than that of zigzag data. My problem was how the Fortran run-time reader procedures interpret the presence and absence of decimal dots. I am not sure that my solution was the best but I read the data lines as character arrays, split them to fields having length 12 characters then I read the fields by read(*) statements.

提交回复
热议问题