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

Home » Public Forums » archive » Reading in a header with blank lines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Reading in a header with blank lines [message #40978] Sun, 19 September 2004 17:27
lloyd is currently offline  lloyd
Messages: 16
Registered: February 2003
Junior Member
Hi all,

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.

TO get around this I have tried:

openr,lun,cloughfilename+"\260.clough",/GET_LUN ; Opening clough
parameters
; from the relevant
files
ON_IOERROR, readerror1 ;On file read error jump to readerror1
for dum1 = 1, headersize do begin
ON_IOERROR, readerror1 ;On file read error jump to readerror2
readf,lun, temp
readerror1: ON_IOERROR, NULL ;Jumps here if there is a file read
error (blank lines in clough files)
endfor

But if an error is detected (i.e. blank line) then it does not move
onto the next line.

Can anyone let me know a correct way to do this? or a command which
will skip to the next line of the code?

Thanks

Lloyd Watkin
[Message index]
 
Read Message
Previous Topic: Re: exinteranimate output window
Next Topic: Re: Reading in a header with blank lines

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

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

Total time taken to generate the page: 0.00446 seconds