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

Home » Public Forums » archive » Re: A very simple FORMAT question
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: A very simple FORMAT question [message #39116 is a reply to message #39112] Wed, 21 April 2004 17:29 Go to previous messageGo to previous message
Andry William (Please is currently offline  Andry William (Please
Messages: 11
Registered: March 2004
Junior Member
Here is the simple data:

------------------------ test.datos ----------------------------
|020922 10:00:00 | 339| 348| 63| 356| 400| 88|
|020922 10:00:00 | 339| 348| 63| 356| 400| 88|
|020922 11:00:00 | 345| 349| 111| 422| 482| 140|
|020922 12:00:00 | 339| 340| 113| 431| 533| 137|
|020922 13:00:00 | 335| 333| 99| 410| 492| 127|
------------------------ End data ------------------------------

Here is the simple program to read it.

------------------------- Simple IDL program -------------------
flnm= 'test.datos'
SPAWN, "wc -l "+ flnm+ " | awk '{print $1}'", lineas
; This can be done in IDL without any problem

lineas= LONG(lineas[0])
data= INTARR(10, lineas)

OPENR, 1, flnm
READF, 1, data, format= '(1x,i6,3(1x,i2),4x,7(1x,i6))'
CLOSE,1
END


> It looks to me that you have 10 things to read on each line,
> and you are trying to read 11 in your format statement. Could
> that be the problem?

That was just a mistyping. I just reproduced part of my data
in order to have it fill the e-mail editor. It should read 10
instead of 11. Here the result when reading the file:

IDL> print,data
20922 10 0 0 339 348 63 356 400 88
20922 11 0 345 349 111 20922 12 0 339
340 113 20922 13 0 335 333 99 0 0
0 0 0 0 0 0 0 0 0 0

Where does go the second "0" of the second line? The problem
keeps occuring even for more columns of data.

Andry
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: simplify a polyline?
Next Topic: Newbie needs help getting mpi_plot going

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

Current Time: Fri Oct 10 08:56:59 PDT 2025

Total time taken to generate the page: 0.00249 seconds