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

Home » Public Forums » archive » Re: How to parse the output of restore, filename, /ver
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to parse the output of restore, filename, /ver [message #83836] Fri, 05 April 2013 17:09
Nikola is currently offline  Nikola
Messages: 53
Registered: November 2009
Member
Great, many thanks! That's exactly what I was looking for.
Re: How to parse the output of restore, filename, /ver [message #83837 is a reply to message #83836] Fri, 05 April 2013 16:41 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Fri, 5 Apr 2013 16:09:06 -0700 (PDT), Nikola Vitas wrote:

> Hi,
>
> Is there a way to capture the output of
>
> restore, filename, /verb
>
> in a string variable? If yes, is there some standard tool to parse it? For example, I'd like to be able to automatically read which variables are saved in a .sav file.
>
> Thanks!

Hi Nikola,

you can get a list of the contents of a save file before or without
restoring it by the IDL_Savefile object:

obj=obj_new('IDL_Savefile',filename)
contents=obj->Contents()
if contents.n_var ge 1 then print,'Variables: ',obj->Names()
if contents.n_sysvar ge 1 then $
print,'System Variables: ',obj->Names(/system_variable)
; and so on
;
obj_destroy,obj

Cheers, Heinz
Re: How to parse the output of restore, filename, /ver [message #83838 is a reply to message #83837] Fri, 05 April 2013 16:31 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/5/13 5:09 PM, Nikola Vitas wrote:
> Hi,
>
> Is there a way to capture the output of
>
> restore, filename, /verb
>
> in a string variable? If yes, is there some standard tool to parse
> it? For example, I'd like to be able to automatically read which
> variables are saved in a .sav file.
>
> Thanks!
>

Use IDL_Savefile instead. See:

https://github.com/mgalloy/mglib/blob/master/src/save/mg_sav e_dump.pro

for an example.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to parse the output of restore, filename, /ver
Next Topic: mapping problem

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

Current Time: Wed Oct 08 13:39:02 PDT 2025

Total time taken to generate the page: 0.00592 seconds