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

Home » Public Forums » archive » Re: Reading files with unknown amount of data
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 files with unknown amount of data [message #1466 is a reply to message #1465] Thu, 30 September 1993 10:47 Go to previous messageGo to previous message
jim is currently offline  jim
Messages: 7
Registered: August 1993
Junior Member
In article <28csjc$qde@news.aero.org> rdavis@aerospace.aero.org
(Robert Davis) writes:
> I am trying to read a data file containing an unknown amount of data into
> arrays in IDL. I know the format of the data in the file, but not the number
> of pieces of data in the file. Currently, I read the file twice; once to
> determine the amount of data in the file and then a second time to actually
> read the data into an array (now that I know the size of array needed).
> Is there a better way to do this (without having to read the file twice)?
>
> Robert Davis
> Member of Technical Staff
> The Aerospace Corporation
> rdavis@aero.org
>
I assume your data file does not have a header
which contains the information you need. If the file has fixed-length
records, you could probably deduce the number of entries from the file
size. You can get the file size using FSTAT. On a Unix box you'll get
the size in bytes, which should get you to the number of records fairly
accurately. If you are running under VMS, the result might only be
good to the nearest multiple of 512 bytes.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Calling External programm
Next Topic: Re: Reading files with unknown amount of dat

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

Current Time: Wed Dec 03 01:49:32 PST 2025

Total time taken to generate the page: 0.24236 seconds