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

Home » Public Forums » archive » Re: Declaring large vectors in IDL
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: Declaring large vectors in IDL [message #70472] Sat, 17 April 2010 15:07 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Apr 17, 5:02 am, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> Thanks for the suggestion. But what if the text file has more than one
> variable in it? Say "a" and "b".

That only depends on how you write them to the file. You should write
the file in the most convenient way, which will depend on what you
need to write, and where the values come from. If the values come from
some other software, the file generated by that software may be
directly readable.

If a and b have the same number of elements, one choice is to write
them as a table, with one column for each. Then it could be read
easily with read_ascii(), read_csv(), or in many other ways.

If they do not have the same length, then writing them using one line
for each may be more convenient, then they can be read with a
combination of readf and strsplit.

Or you may use key=value pairs, and read them, as Gray suggested, or
with gettok() from idlastro. If you have many variables of different
dimensions to be read (such as a file with many parameters on how to
do something, or metadata), this may be the most convenient way, since
it is easy to be read and edited by humans, and easy to parse. It is
even simple to write a general parser, which would return all key/
value pairs in a structure (or, when IDL 8 comes out, in a hash).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Comparison operators and floating-point errors
Next Topic: Re: Virtual machine popup

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

Current Time: Wed Oct 08 15:19:32 PDT 2025

Total time taken to generate the page: 0.00415 seconds