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

Home » Public Forums » archive » Re: Reading in a header with blank lines
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: Reading in a header with blank lines [message #40973] Mon, 20 September 2004 03:51
lloyd is currently offline  lloyd
Messages: 16
Registered: February 2003
Junior Member
Yeah I tried this originally, and it didn't work. Tried it again as I
may of made a mistake the first time, and it works with no problems
(obviously I had done something stupid again).

Thanks very much,

Lloyd
Re: Reading in a header with blank lines [message #40974 is a reply to message #40973] Mon, 20 September 2004 03:51 Go to previous message
lloyd is currently offline  lloyd
Messages: 16
Registered: February 2003
Junior Member
Yeah I tried this originally, and it didn't work. Tried it again as I
may of made a mistake the first time, and it works with no problems
(obviously I had done something stupid again).

Thanks very much,

Lloyd
Re: Reading in a header with blank lines [message #40976 is a reply to message #40974] Sun, 19 September 2004 23:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lloyd Watkin writes:

> I'm trying to read in an ascii file which has a 73 line header. I've
> tried to read it in to an array by doing:
>
> header = fltarr(73)
> open, lun, filename, /GET_LUN
> readf, temp
>
> The problem is that the header contains some blank lines and so I am
> getting a type conversion error on trying to read in the data.

Read the header as a string array, not as a float array.
Later, if you need numbers out of the header, use READS
to read them from your string array.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading in a header with blank lines
Next Topic: self made color tables

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

Current Time: Wed Oct 08 15:34:56 PDT 2025

Total time taken to generate the page: 0.00576 seconds