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
New Contributor I
617 Views
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 Kudos
2 Replies
Steven_L_Intel1
Employee
617 Views
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 Kudos
rahzan
New Contributor I
617 Views
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 Kudos
Reply