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

Home » Public Forums » archive » A very simple FORMAT question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
A very simple FORMAT question [message #39123] Wed, 21 April 2004 14:58
Andry William (Please is currently offline  Andry William (Please
Messages: 11
Registered: March 2004
Junior Member
Hi all,

Sorry for this very simple question but I would appreciate if
someone can help in the use of FORMAT in READF command.

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(11, lineas)

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

For some reason (I don't understand why) the READF command
reaches the end of the file and can not close it. The variable
"data" contains the following (not correct) values:

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

First, I am missing the second "0" value at the second line, and so
on. Any suggestion on what I am doing wrong in the formatted
reading?

Thanks for any help,

Andry
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: xmanager to call object methods?
Next Topic: Notice on IDL Alpha/Tru64 Support

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

Current Time: Thu Oct 09 22:20:07 PDT 2025

Total time taken to generate the page: 1.20004 seconds