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 #39121 is a reply to message #39119] Wed, 21 April 2004 12:31 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
"Andry William (Please remove \".spam\")" <andry@ya.com.spam> writes:

> 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.

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?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[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: Thu Oct 09 14:52:41 PDT 2025

Total time taken to generate the page: 0.08253 seconds