comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » READ_CSV: just one data field (=one column)?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
READ_CSV: just one data field (=one column)? [message #85578] Mon, 19 August 2013 01:20 Go to next message
Therese is currently offline  Therese
Messages: 5
Registered: May 2013
Junior Member
Hello all,

I have a big problem with reading in a CSV file (comma delimited) created by Excel 2010. It contains various data (string, float, integer) in the columns and also has the column names in the first row.

My problem: READ_CSV read my *.csv but contains the whole row in one element of the result structure

Below I want to show you a minimum example with two columns of different data types and the column names "column1" and "column2"

XLSX-file:
column1 column2
row1 1
row2 2
row3 3
row4 4

CSV-file
column1;column2
row1;1
row2;2
row3;3
row4;4

for QUERY_CSV I get
IDL> test = QUERY_CSV(csvfile,info)
IDL> print,info
{ filepath*.csv CSV 5 1}

therefore, my resulting structure also contains just one field:
IDL> result = READ_CSV(csvfile, HEADER=head)
IDL> help,result
** Structure <27fbef0>, 1 tags, length=60, data length=60, refs=1:
FIELD1 STRING Array[5]

What am I doing wrong? Maybe, there is a problem in creating the CSV-file? Please help me!

Best regards,
Therese
Re: READ_CSV: just one data field (=one column)? [message #85579 is a reply to message #85578] Mon, 19 August 2013 01:43 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi Therese,

In your example it seems that your CSV-file is not comma-delimited but
semicolon-delimited. You should tell Excel to use commas as separator,
not semicolon.

Cheers
Re: READ_CSV: just one data field (=one column)? [message #85580 is a reply to message #85579] Mon, 19 August 2013 02:38 Go to previous message
Therese is currently offline  Therese
Messages: 5
Registered: May 2013
Junior Member
On Monday, August 19, 2013 10:43:21 AM UTC+2, Fabien wrote:
> Hi Therese,
>
>
>
> In your example it seems that your CSV-file is not comma-delimited but
>
> semicolon-delimited. You should tell Excel to use commas as separator,
>
> not semicolon.
>
>
>
> Cheers

Thank you, that's it!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Progress Bar - Cancel button problem
Next Topic: Tooltip for CW_BGROUP?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:08:13 PDT 2025

Total time taken to generate the page: 0.11827 seconds