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

Home » Public Forums » archive » Re: Am I having a blackout?
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: Am I having a blackout? [message #66645] Fri, 29 May 2009 05:31 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
I always have to remind myself each time exactly the right way to do
this but I am a big fan of reading in text files into a structure all
in one go.

Give something like this a try, for my brain this is the best way.


file='idl.dat'
lines=file_lines(file)
dat={date:0L, data:fltarr(5)}
dat=replicate(dat, lines)
openr, lun, file, /get_lun
readf, lun, dat
free_lun, lun
print, dat.date
; 20050206 20050207 20050402 20050411 20050421
20050422
; 20050423 20050614 20050618 20050619
print, dat.data[0]
; 0.386216 0.391236 0.685645 0.727419 0.768319
0.772067
; 0.775750 0.878818 0.879916 0.880047





Cheers,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
http://people.bu.edu/balarsen/Home/IDL
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Debugging Rules
Next Topic: Re: read multiple files with varying names

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

Current Time: Wed Oct 08 17:19:16 PDT 2025

Total time taken to generate the page: 0.00500 seconds