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

Home » Public Forums » archive » Re: Reading a set of data with string type entries
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: Reading a set of data with string type entries [message #57079 is a reply to message #57077] Thu, 29 November 2007 23:07 Go to previous message
izimine is currently offline  izimine
Messages: 11
Registered: November 1997
Junior Member
IDL> s = strjoin(['info', string(randomu(seed,10))], ' ')
IDL> vals = float((strsplit(s, ' *', /regex, /extract))[1:*])

For large files I sometimes read the whole thing into a bytarr and
split on line breaks
something like

openr, lun, 'big.txt',/get_lun
fs = fstat(lun)
buf = bytarr(fs.size)
readu, lun, buf
free_lun, lun
buf = strsplit(string(buf), string([13b,10b]),/extract) ; split on CR
+LF
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: about widgets
Next Topic: Re: IDL 7.0 .... any new functions?

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

Current Time: Wed Oct 08 19:33:51 PDT 2025

Total time taken to generate the page: 0.00431 seconds