Re: Reading string array [message #11238] |
Thu, 19 March 1998 00:00 |
Alex Schuster
Messages: 124 Registered: February 1997
|
Senior Member |
|
|
Neil Winrow wrote:
> 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.
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.
Another thing, I recomend using the GET_LUN keyword with OPEN, so you
don't have to hardcode the unit number.
OPENR, unit, filename, /GET_LUN
...
FREE_LUN, unit
Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
|
|
|