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

Home » Public Forums » archive » Re: unexpected EOF?
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: unexpected EOF? [message #19703] Wed, 12 April 2000 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Kyung Byun (kbyun@fas.harvard.edu) writes:

> I have a function that is supposed to take a text file and remove the
> top few lines and bottom lines (I'm trying to extract the middle bunch
> of lines in the text...the files I'm feeding this function are all
> basically the same format). I'm running the program and on the
> readf, ... line I'm getting the following message:
> % READF: End of file encountered. Unit: 101, File: HEFTmimic2.ef
> % Execution halted at: STRIP 27 /data/mlf2/area/2conefolder/oplot_eax.pro
> % $MAIN$ 79 /data/mlf2/area/2conefolder/oplot_eax.pro
> ie, IDL is telling me that the file I'm feeding into it ('HEFTmimic2.ef')
> has an EOF at the beginning of the file (?!) that is preventing it from
> going further. The file 'HEFTmimic2.ef' is not empty, so I don't know
> what the message means.

No, I think IDL is trying to tell you that you aren't
doing what you *think* you are doing, but I don't
know why it always chooses this esoteric message
to do so. I would prefer something like "Oh, come
on. Get real!"

The problem here is that IDL *always* reads to the
end of the line when reading into a string variable.
It looks to me like you are reading about twice as
many lines of text as you are intending to read.
Hence, you are reading past the end of file mark.
(Oh, well, I guess that message *does* make
some sense.)

I would define "allarray" like this:

allarray = StrArr(alllines)

Then I would look for the word "ENERGY" in just
the first 6 characters of each line, as you are doing
now.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Compiling shared libraries for use with call_external on a Mac
Next Topic: unexpected EOF?

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

Current Time: Sat Oct 11 11:44:55 PDT 2025

Total time taken to generate the page: 0.48468 seconds