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

Home » Public Forums » archive » How to read a csv file?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How to read a csv file? [message #86174] Wed, 16 October 2013 07:46 Go to previous message
galaxytraveler42 is currently offline  galaxytraveler42
Messages: 5
Registered: October 2013
Junior Member
I have tried using the read_csv command:

data = read_csv(path+'filename.csv',HEADER=SedHeader)

and it it seems to work:
Help, data:
** Structure <2161e08>, 28 tags, length=5600, data length=5600, refs=1:
FIELD01 STRING Array[20]
FIELD02 STRING Array[20]
FIELD03 DOUBLE Array[20]
FIELD04 DOUBLE Array[20]
FIELD05 DOUBLE Array[20]
.... (I have shortend it here)

print, SedHeader
id full_name diameter H extent ...

Now I would like to have the different columns in the csv out in individuel arrays. But here is my problem, what is the command?

I have tried without luck:
print, diameter
>%PRINT: Variable is undefined: DIAMETER.
print, field03
>% PRINT: Variable is undefined: FIELD03.
col3=data(3, *)
print, col3
>% Attempt to subscript DATA with <INT ( 3)> is out of range.

What is the magic word?


PS: I am using a Mac computer
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Store differents size of .fits into one single array
Next Topic: More Kriging Problems

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

Current Time: Wed Oct 08 11:33:43 PDT 2025

Total time taken to generate the page: 0.00428 seconds