Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

reading fron CSV files

rahzan
新分销商 I
616 次查看
Saving an xls file in csv format "Looks" like it only writes a text file with comma delimited fields.
However, (at least using cvf 6.6) when this file is opened and read, as with:
character(80)::line
open(1,file='whatever.csv')
read(1,*)line
given that using a text editor that the line is somehting like
ABC,12345
on debug of the above, ONLY the first token is stored in the variable Line.
Arethere hidden characters in csv files which trick a simple read? or...?
Any hints will be appreciated.
Tim
0 项奖励
2 回复数
Steven_L_Intel1
616 次查看
Don't use list-directed input for this. An unquoted character value will end at the first delimiter - the comma in this case. Use (A) format instead.
0 项奖励
rahzan
新分销商 I
616 次查看
Yes I just discoverd that.
I would swear that I've done this zillions of times and it was not a problem.
This is what heppens when scatterbrain people program in many different languages. Can't keep any of it straight!!
Thanks.
0 项奖励
回复