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

Home » Public Forums » archive » need a quicker way to read ascii file w/a structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
need a quicker way to read ascii file w/a structure [message #25355] Tue, 05 June 2001 15:24
differentiable is currently offline  differentiable
Messages: 5
Registered: June 2001
Junior Member
OK. I've got an ascii file laid out in columns with a string in the
first column, like this

yyyy-ddd // hh:mm:ss.ms 0 12 -1.00 -1.00 -1.00 -1.00
.
.
.
(lots and lots of rows)

I defined a structure
mystruct = {utctime: ' ',mpos: 0, sector: 0,$
arate: 0.0, brate: 0.0, crate: 0.0, drate: 0.0}

I know the number of rows so I replicate,
data = replicate(mystruct,num_of_rows)

and I read,
readf, myfilelun, data

and find out that the entire row is read into my mystruct.utctime
string variable. I've been hunting the message board and have tried
many, many different things. The only thing I can think of doing at
this point is reading my file in as a string array, separating it into
variables, and feeding it into my structure. (I don't want to use an
explicit format statement because the format varies....) This would
take a LOT of time, and besides isn't there a more elegant way to do
it? I'm looking through a few of the canned routines (Knight's
DDREAD.PRO, etc...) that were suggested, but frankly I don't want to
use anything I don't understand... please HELP!!

Thanks in advance! Lucas
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Top ten?
Next Topic: sec : U Re: need a quicker way to read ascii file w/a structure

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

Current Time: Fri Oct 10 06:03:47 PDT 2025

Total time taken to generate the page: 1.43830 seconds