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

Home » Public Forums » archive » Read ASCII
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: read ascii [message #63767 is a reply to message #10591] Mon, 17 November 2008 07:14 Go to previous messageGo to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
yikes, bytes, bits, structures, and splitting oh my. That certainly
works but... yikes

This can be done with a cleaver call to format and a type conversion
that is (in my opinion) the best and fastest way. Play with the type
conversion as you want I didn't include it here.

lines=file_lines('test.dat')
dat = strarr(3, lines)
openr, lun, 'test.dat', /get_lun
readf, lun, dat, format = '(a4,a16,a)'
free_lun, lun
IDL> print, dat[0,*]
SMA
SMA
SMA
SMA
SMA
SMA
SMA
SMA
SMA
SMA
IDL> print, dat[1,*]
200001010010
200001010020
200001010030
200001010040
200001010050
200001010100
200001010110
200001010120
200001010130
200001010140
IDL> print, dat[2,*]
0
0
1
0
3
4
5
0
0
0


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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: idl for solaris
Next Topic: IDL and sqlite

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

Current Time: Fri Nov 28 09:46:09 PST 2025

Total time taken to generate the page: 0.00845 seconds