need a quicker way to read ascii file w/a structure [message #25355] |
Tue, 05 June 2001 15:24 |
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
|
|
|