|
地板
楼主 |
发表于 2017-3-2 10:40:05
|
只看该作者
谢谢大神,但是我更改完地址之后,如:
[Fortran] 纯文本查看 复制代码
program main
implicit none
integer :: i=48
real ::f(48)
real ::ef10=1.09,ef25=0.31
real a(48),b(48)
open(12 , file ="/home/iga_qtong/fortran_xcao/fa.csv")
read(12,*)
do i=1,48
read(12,*) f(i)
end do
a(i)=f(i)*ef10
b(i)=f(i)*ef25
write(12,*) f(i),',',a(i),',',b(i)
close(12)
end program main
还是出现了以下问题,forrtl: severe (24): end-of-file during read, unit 12, file /home/iga_qtong/fortran_xcao/fa.csv
Image PC Routine Line Source
faa.exe 00000000004052C6 Unknown Unknown Unknown
faa.exe 0000000000418923 Unknown Unknown Unknown
faa.exe 0000000000402D88 Unknown Unknown Unknown
faa.exe 0000000000402C7E Unknown Unknown Unknown
libc.so.6 0000003358A1ED1D Unknown Unknown Unknown
faa.exe 0000000000402B89 Unknown Unknown Unknown
并没有输出我想要的csv格式,我查看之后发现有人输出csv,使用了
real ::f_openfile f_openfile=shellexecute(0,"open","/home/iga_qtong/fortran_xcao/fa.csv",null,null,12)
但是把这句加入会出现以下错误:
faa.f(18): error #5120: Unterminated character constant
f_openfile=shellexecute(0,"open","/home/iga_qtong/fortran_xcao/fa.csv",null,null,12)
---------------------------------------^
faa.f(18): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) :: , :
f_openfile=shellexecute(0,"open","/home/iga_qtong/fortran_xcao/fa.csv",null,null,12)
------------------------------------------------------------------------------------------^
faa.f(18): error #6404: This name does not have a type, and must have an explicit type. [SHELLEXECUTE]
f_openfile=shellexecute(0,"open","/home/iga_qtong/fortran_xcao/fa.csv",null,null,12)
-----------------^
compilation aborted for faa.f (code 1)
请问,想要输出到底是什么格式呢?
|
|