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
Re: How to read a csv file? [message #86175 is a reply to message #86174] Wed, 16 October 2013 07:52 Go to previous messageGo to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den onsdagen den 16:e oktober 2013 kl. 16:46:44 UTC+2 skrev galaxytr...@gmail.com:
> 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?

I have never used read_csv but the fact that the data is a structure suggests that this should do it:

print,data.field03
[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 15:57:56 PDT 2025

Total time taken to generate the page: 0.00481 seconds