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

Home » Public Forums » archive » Re: converting to array
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: converting to array [message #24129] Wed, 14 March 2001 09:06 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Norbert Hahn wrote:

> 1) If the data is written by a program that I can put my
> hand on, I usually read the data under format control.
>
> 2) If the data comes from some unknown source I prefer to
> read the data into a string at first and analyze that
> string. This is to prevent program breaks due to wrong
> data.

I am sorry, but I am not with you on this one.

I deal with bizarre file formats all the time. None of them are written
by programs I can get my hand on. Most have over 100,000 data records,
some have more. If I read all that via string parsing, I still would be
reading the files, months after I started :-(

My approach is, if I can comprehend the file format, I use a formatted
read as close to the data structure as possible. IDL can read a 10
column by 100,000 rows numeric array from a file in split second. But to
loop through 100,000 rows, read a string each time ans READS will take
minutes at least.

The drawback is, it might take effort to figure out the optimal way to
create the format itself. But it pays off tenfold, if you have more than
one file to read.

But, like everything else, it is all the matter of personal preference.

Cheers,
Pavel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: plot structured data II
Next Topic: linkimage query

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

Current Time: Sat Oct 11 07:52:52 PDT 2025

Total time taken to generate the page: 1.67918 seconds