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

Home » Public Forums » archive » Re: Reading and Plotting big txt. 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: Reading and Plotting big txt. File [message #55168 is a reply to message #55117] Thu, 02 August 2007 09:55 Go to previous messageGo to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
The problem is your format statement. What's going on is that with a
format, IDL doesn't actually read columns. It is more of directions
where to find the data. In your case, you aren't telling it where the
spaces are, so it assumes that everything is a data column. If you
specify 10(a4), it is really reading:

aaaabbbbccccddddeeeffffgggghhhhiiiijjjj

where aaaa = column1, bbbb = column2, etc...

You need to give it the appropriate number of spaces, otherwise the
data get's all messed up. For example, apply the above "filter" to
the data below (from your file)

7 -1848 -1792 -1718 -1678 -1638 -1576 -1517
-1446 -1372 -1322

The first four columns ' 7 ' are assigned to the first column in your
data array. The second four columns ' ' go to the second column in
your data array, etc.. In the end you get:

data = [ 7 ',' ',' -1','848 ',' -17','92 ',' -17','18 ',' -16']

(or something along those lines, anyway)

What you need to do is actually specify where the spaces are:

format = '(a2, 7x, a4, 2x, a4, 7( 3x, a4 ) )'

I don't think that's quite it, but it probably needs to be something
along those lines. I can't quite get it to work myself,
unfortunately. I wish someone better informed about formats would
join in the conversation here...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Question on collection change - MOD07 air profile
Next Topic: Re: Another HDF File Question

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

Current Time: Fri Nov 28 11:50:31 PST 2025

Total time taken to generate the page: 1.36281 seconds