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

Home » Public Forums » archive » Q: About reading files into an array without knowing the size.
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: Q: About reading files into an array without knowing the size. [message #5337 is a reply to message #5205] Tue, 07 November 1995 00:00 Go to previous messageGo to previous message
mirko.vukovic is currently offline  mirko.vukovic
Messages: 6
Registered: November 1995
Junior Member
In article <DHMELp.JDM@news.dlr.de>, H.Mannstein@dlr.de says...
>
> David van Kuijk <kuijk@mpi.nl> wrote:

> with
> OPENR,1, "filename"
> a=fstat(1)
> floatss=fltarr(a.size/4)
> READF, 1, floatss
>
> you will get what you want, but you have to know, what type of data
"filename"
> contains.
> --
> Regards,
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
~~~~~~~~
> Hermann Mannstein Tel.: +49 8153
Well, I tried that and it does not quite work, since fstat returns the
file size in bytes. If you are reading ascii, the division by 4 (4 bytes
for floating point variables) is not correct. How many bytes/character
(0.5?)
Now, if fstat returned the number of records in a file, that would be
something usefull, provided one knew how many columns are in the file.

--
Mirko Vukovic, PhD mirko.vukovic@grc.varian.com
Varian Research Center Phone: (415) 424-4969
3075 Hansen Way, M/S K-109 Fax: (415) 424-6988
Palo Alto, CA 94304-1025
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 3D velocity field representation
Next Topic: How can I add parameter to curvefit?

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

Current Time: Wed Oct 08 19:17:34 PDT 2025

Total time taken to generate the page: 0.00516 seconds