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

Home » Public Forums » archive » Reading string array
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
Reading string array [message #11242] Thu, 19 March 1998 00:00 Go to next message
Neil Winrow is currently offline  Neil Winrow
Messages: 18
Registered: July 1997
Junior Member
I have the following problem:

openr,10,filnam
dataTitle = make_array(7,/string)
for i=1,30 do readf,10,a ;read the header information
readf,10,dataTitle
close,10

The piece of code above is supposed to read over the header information
in the data file, and read in the following column titles into
dataTitle:

X Y Z FLUX MAXL MAXM IMIN

But this doesn't work, is there some obvious mistake I'm making with my
code.

Thanks

Neil
Re: Reading string array [message #11362 is a reply to message #11242] Fri, 20 March 1998 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Alex Schuster wrote:
>
> Neil Winrow wrote:
>
>> in the data file, and read in the following column titles into
>> dataTitle:
>>
>> X Y Z FLUX MAXL MAXM IMIN
>>
>
> IDL has to know how long the individual strings are. You can use
> READF, 10, dataTitle, format='(7A7)'
> assuming that each string is seven characters long.
>

.. or you can use STR_SEP to get your header "tokens" out of one header
line. Your problem sounds to me as if you may want to try my readdata
routine which you find on the web page indicated below.

Martin.


--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to upgrade IDL, Poor support
Next Topic: Window Contents Directly to Printer

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

Current Time: Fri Oct 10 20:11:56 PDT 2025

Total time taken to generate the page: 0.56080 seconds