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

Home » Public Forums » archive » Re: question on READ_CSV
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: question on READ_CSV [message #83464 is a reply to message #83463] Mon, 04 March 2013 20:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
andry writes:

> I have a CSV file (example below)
>
> 1,11,06,30,12,57,30,00,,69,39
> 2,11,06,30,13,17,30,00,,68,39
> 3,11,06,30,13,37,30,00,,77,52
> 4,11,06,30,13,57,30,00,,70,44
> 5,11,06,30,14,17,30,00,,72,64
>
> When I read the above file with READ_CSV
> a=READ_CSV(flnm, missing_value=-9999)
>
> I expect the column 9 (starting from 1) to be -9999. However, it skips that column as if there is no column with missing value at all.
>
> Does somebody know how I can force the function to assign the right missing value to that column?

Here is the problem:

IDL> str = '1,11,06,30,12,57,30,00,,69,39'
IDL> parts = StrSplit(str, ',', /Extract)
IDL> Help, parts
PARTS STRING = Array[10]
IDL> FOR j=0,N_Elements(parts)-1 DO Print, parts[j]
1
11
06
30
12
57
30
00
69
39

You see, the column has disappeared.

I don't think whoever wrote this program envisioned an entire COLUMN
going missing. They were thinking about specific values in otherwise
intact columns going missing.

I think I would try to find a way to stick my -9999 between those two
extra commas in the data file.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: question on READ_CSV
Next Topic: Re: setintersection assumes sets have no repetitions?

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

Current Time: Wed Oct 08 19:57:18 PDT 2025

Total time taken to generate the page: 0.00357 seconds