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 #23645 is a reply to message #23627] Wed, 07 February 2001 09:11 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Sure does work, Martin :-)

;**************************
pro test
buffer = {a : '', b: fltarr(7)}
result = replicate(buffer, 6)
temp = dialog_pickfile()
; Pick the file with Surendar's data
openr, unit, temp, /get_lun
readf, unit, result, format='(4x,a4,7f9.3)'
free_lun, unit
; No need in subscripting
help, result.(1)
end
;**************************

Cheers,
Pavel

Martin Schultz wrote:
>
> The solution is to use a structure. SOmething like this (no time for
> testing though):
>
> template = { a:'', x:fltarr(7) }
> result = replicate(template, NLINES)
> readf, lun, result, format='(4x,a4,7f9.3)'
>
> data = result[*].x ; not sure if this even works ;-(
>
> Hope this helps you a little bit,
>
> Martin
[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: Sun Oct 12 12:23:53 PDT 2025

Total time taken to generate the page: 2.07888 seconds