How to write Fortran Output as CSV file?

后端 未结 5 1056
死守一世寂寞
死守一世寂寞 2020-12-17 18:01

Can any one tell me, how can I write my output of Fortran program in CSV format? So I can open the CSV file in Excel for plotting data.

5条回答
  •  天命终不由人
    2020-12-17 18:51

    A slightly simpler version of the write statement could be:

    write (1, '(1x, F, 3(",", F))') a(1), a(2), a(3), a(4)
    

    Of course, this only works if your data is numeric or easily repeatable. You can leave the formatting to your spreadsheet program or be more explicit here.

提交回复
热议问题