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

Home » Public Forums » archive » Re: problem with reading formated 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: problem with reading formated file [message #10160 is a reply to message #10158] Fri, 10 October 1997 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Pavel Eiges wrote:
>
> Hello!
>
> i'm new in IDL programming so my question may be very
> dumb/simple/funny/etc but i cant solve this problem by myself.
>
> i have a formated file like this:
> ===========================
> 1877383765 1.778
> 1877384765 1.685
> 1877385765 1.599
> 1877386765 1.599
> 1877387765 1.685
> ===========================
> and i need to load it into two arrays. the first array is LONG-type,
> the second one - FLOAT-type. How i can do this?
> ("READF, file, Time, Data" does not work).
>
> %-\ HELP!
>
> Pavel Eiges



You must specify a format='(...)' statement with the READF command. In
your case thi swoul dbe something like

READF,file, time, data, format='(3X,i10,f9.3)'

Also, because time is a long variable, you may have to assign it to a
long value before you call READF, e.g. time=0L (well, you don't have to:
IDL converts it into a float if you don't. But this way you can save it
as a long variable if you like to).

Cheers,
Martin.




------------------------------------------------------------ ------------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-9837
Please indicate name and room (186 Pierce) when sending a fax

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ ------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: widget_control,draw_widget
Next Topic: open windows with IDL on two monitors?

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

Current Time: Thu Oct 09 07:49:04 PDT 2025

Total time taken to generate the page: 1.12104 seconds