erratic EOF encountered when reading in similar data [message #44709] |
Tue, 12 July 2005 08:11 |
Catherine
Messages: 1 Registered: July 2005
|
Junior Member |
|
|
Hi
I'm having trouble understanding why I sometimes cannot read in data
due to an EOF encounter which is not supposed to be there.
All my data files are in the same format (on visual inspection) :
Header with 10 lines of information, including how long the data will
be, and then the data itself which consists of floating precision
numbers in 7 columns by 1125 rows.
I read in the file as follows:
if (file) then begin
status=fstat(1)
openr, lun1, file, /get_lun
print, 'Opening : ',file
header = strarr(10)
readf, lun1, header
reads, header[1], version, format="(9X,F4)"
if (version EQ x) then begin
...
studytime = FIX(header[6])
size_array = studytime
data = dblarr(7,size_array)
WHILE NOT EOF(lun1) do readf, lun1, data
close, lun1
free_lun, lun1
end
...
But sometimes I cannot get passed the EOF criterium and wonder whether
it is possible make sure there are no hidden tabs at the end of the
last header line that could prevent it from proceding.
Or perhaps there is something else that I'm doing wrong..
Has anyone else had this before?
|
|
|