由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - help fortran read format
相关主题
fortran求助!where to down a standard Fortran90 complier?
<>全书下载一工程计算站点
Fortran里面哪个函数显示系统时间?Write In C
Re: help fortran read format, why not try excel?Include unix libraries in windows fortran
[合集] Matlab输出的文件怎么读进fortran?Fortran和C++的数据转换问题
Matlab 读取文件的问题[转载] How to check the stack-size?
Re: anyone know how to compile a libary coded in c which any be used bg77与f90结合的问题
哪里有Fortran教程可下?Vi看来不是很适合编辑Fortran程序啊,不如emacs!
相关话题的讨论汇总
话题: read话题: format话题: fortran话题: may话题: 12
进入Computation版参与讨论
1 (共1页)
p*w
发帖数: 124
1
I have a file, the data is
8-may-12,12.00,16.00,15.00
9-may-12,13.00,15.00,17.00
10-may-12,................
11-may-12,................
the problem is the initial field is
a string with variant length,
how to specify it so I can use a sigle
read to read them in?
thanks.
t*n
发帖数: 14458
2
use format, like
read(*,100) x1,x2,x3,......
100 format(9X, F5.2,1X, F5.2, 1X, F5.2,.....)

【在 p*w 的大作中提到】
: I have a file, the data is
: 8-may-12,12.00,16.00,15.00
: 9-may-12,13.00,15.00,17.00
: 10-may-12,................
: 11-may-12,................
: the problem is the initial field is
: a string with variant length,
: how to specify it so I can use a sigle
: read to read them in?
: thanks.

p*w
发帖数: 124
3
not working, because the first field could be 9 or 10 character.

【在 t*n 的大作中提到】
: use format, like
: read(*,100) x1,x2,x3,......
: 100 format(9X, F5.2,1X, F5.2, 1X, F5.2,.....)

w*******g
发帖数: 99
4
I don't think you can do it with single format... Perhaps this will happen in
the future F2000 not in 77/90/95 as I know.

【在 p*w 的大作中提到】
: I have a file, the data is
: 8-may-12,12.00,16.00,15.00
: 9-may-12,13.00,15.00,17.00
: 10-may-12,................
: 11-may-12,................
: the problem is the initial field is
: a string with variant length,
: how to specify it so I can use a sigle
: read to read them in?
: thanks.

t*n
发帖数: 14458
5
you can try to use Ultraedit to add an additionala blank
hehehe

【在 p*w 的大作中提到】
: not working, because the first field could be 9 or 10 character.
g****d
发帖数: 64
6
Try to read the first commer with charactor
variable or a spring variable. Then use 'if'
condition to judge the start of your data.
It should work. There are serveral ways to
achieve your purpose.
Even though Fortran is weak in this area, still
lots of stuff can be done.

【在 p*w 的大作中提到】
: I have a file, the data is
: 8-may-12,12.00,16.00,15.00
: 9-may-12,13.00,15.00,17.00
: 10-may-12,................
: 11-may-12,................
: the problem is the initial field is
: a string with variant length,
: how to specify it so I can use a sigle
: read to read them in?
: thanks.

t*n
发帖数: 14458
7
smart. ^o^

【在 g****d 的大作中提到】
: Try to read the first commer with charactor
: variable or a spring variable. Then use 'if'
: condition to judge the start of your data.
: It should work. There are serveral ways to
: achieve your purpose.
: Even though Fortran is weak in this area, still
: lots of stuff can be done.

p*w
发帖数: 124
8
what is spring variable?
never heard of it

【在 g****d 的大作中提到】
: Try to read the first commer with charactor
: variable or a spring variable. Then use 'if'
: condition to judge the start of your data.
: It should work. There are serveral ways to
: achieve your purpose.
: Even though Fortran is weak in this area, still
: lots of stuff can be done.

g****d
发帖数: 64
9
Sorry, it is string variable. Poor typing.

【在 p*w 的大作中提到】
: what is spring variable?
: never heard of it

1 (共1页)
进入Computation版参与讨论
相关主题
Vi看来不是很适合编辑Fortran程序啊,不如emacs![合集] Matlab输出的文件怎么读进fortran?
STrange problem in Fortran programmingMatlab 读取文件的问题
Is there any documentation available for Intel Fortran 90 under linux?Re: anyone know how to compile a libary coded in c which any be used b
Re: Is there any documentation available for Intel Fortran 90 under li哪里有Fortran教程可下?
fortran求助!where to down a standard Fortran90 complier?
<>全书下载一工程计算站点
Fortran里面哪个函数显示系统时间?Write In C
Re: help fortran read format, why not try excel?Include unix libraries in windows fortran
相关话题的讨论汇总
话题: read话题: format话题: fortran话题: may话题: 12