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 #63764 is a reply to message #10591] Mon, 17 November 2008 07:18 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Brian Larsen schrieb:
> yikes, bytes, bits, structures, and splitting oh my. That certainly
> works but... yikes
>

yeah

can one make a speed comparision and the other question can format be
used with structures too?

cheers
Reimar

> 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 Oct 10 03:09:38 PDT 2025

Total time taken to generate the page: 0.00193 seconds