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

Home » Public Forums » archive » Re: Help with reading structure from file
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: Help with reading structure from file [message #23699 is a reply to message #23645] Thu, 08 February 2001 09:42 Go to previous messageGo to previous message
jeyadev is currently offline  jeyadev
Messages: 78
Registered: February 1995
Member
In article <95q2fs$m1c$1@news.wrc.xerox.com>,
Surendar Jeyadev <jeyadev@wrc.xerox.com> wrote:
> In the loosing battle with the Excel users, the latest direct hit was reading
> in a file that contained strings and numeric data in each line. Having given
> up (and as the only hold out against Excel!), I need HEEELLLPPP.
>
> This is the simplified problem. I am trying to read data in the following
> format:
>
> 001a 312.194 76.922 296.301 21.462 0.453 289.515 0.957
> 001b 363.748 106.090 506.188 19.430 0.528 347.252 1.176
> 001c 398.248 138.541 724.470 17.152 0.578 383.534 1.701
> 002a 294.593 28.525 248.744 8.532 0.428 290.497 1.268
> 002b 353.415 46.290 449.015 7.974 0.513 349.565 2.011
> 002c 401.279 80.260 661.701 3.341 0.582 395.403 4.529
> ....
> ....
>
> i.e. in the format "(4x,a4,7f9.3)". I would like it to go into a 2 dimensional
> structure.
>
> I cannot find a way of reading it as a entire array. At present, all I can
> come up with is
>
>
> nsets = 108 ; number of lines of data
> f1 = "(4x,a4,7f9.3)"
> a = string(4)
> y = fltarr(7)
> dpt = { fullrow, id: ' ', x: fltarr(7) }
> fulldata = replicate( {fullrow}, nsets)
>
> openr, 1, 'data'
> for i=0,nsets-1 do begin
> readf, 1, format = f1, a, y
> fulldata(i).id = a
> fulldata(i).x = y
> endfor
> close, 1
>
> Is there any way of avoiding the temporary variables and the loop? I am
> using PV-Wave CL, Ver 6.

Thanks to everyone for all the help. Just got a call from PV Wave support.
Looks like it *is* a Wave thing -- the man assures me that there is no
other way to do it. Now, one would expect them to document why that should
be so, wouldn't one? I asked if this was true for any kind of mixed record
but the man was not sure -- thought that it may be something limited to
strings. So much for that.

Thanks again.
--

Surendar Jeyadev jeyadev@wrc.xerox.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: filename
Next Topic: Re: Bug? yea or nay.

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

Current Time: Sat Nov 29 15:14:31 PST 2025

Total time taken to generate the page: 0.87810 seconds