Reading in a header with blank lines [message #40978] |
Sun, 19 September 2004 17:27 |
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
|
|
|