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

Home » Public Forums » archive » Re: ascii_template advanced
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: ascii_template advanced [message #49997] Fri, 08 September 2006 09:04 Go to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
read_ascii is an IDL joke to scare away new users... try something
easier like:

s=strarr(file_lines(filename))
openr,1,filename
readf,1,s
close,1
s=(s[where(strmid(s,0,1) ne '#')])[1:*] ;get rid of the comments and
field names
time=strmid(s,0,8) ;time is a tricky format - take it as a string for
now
s=strmid(s,9) ;chop the time off
m=replicate({voltage:0.,current:0.,temp:0.},n_elements(s)) ;make your
structure array
s=strjoin(strsplit(strjoin(s,','),';',/extract),',') ;swap those pesky
semicolons for commas
reads,s,m ;make the conversion

regards,
greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: READS, input, struct vs. READS, input, var1,var2, etc.
Next Topic: Re: IDLVM and retall

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

Current Time: Wed Oct 08 13:41:42 PDT 2025

Total time taken to generate the page: 0.00374 seconds