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

Home » Public Forums » archive » the last line of a large file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
the last line of a large file [message #55246] Thu, 09 August 2007 12:49 Go to previous message
queiny is currently offline  queiny
Messages: 15
Registered: November 2005
Junior Member
Hi,

I am processing a large file with data in the same format till the
last line. In the last line, it states how many records are included
in this file.

So the structure of my program is:

while not eof(in_unit) do begin
readf, in_unit, input_line
if( input_line ne 'last line) then begin
.....
else
....
endif
endwhile

Do I have to use 'if/then' to test whether every input_line is the
last line of the file? Since there are many data records in the file,
repeat calls to 'if/then' can be time consuming. But if I don't do the
test, the program will be halted when it read in the last line.

A Easy way I can think of is to delete the last line, but sometime we
are not supposed to change the input files.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL resources
Next Topic: IDL resources on my Web page

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

Current Time: Thu Oct 09 20:58:39 PDT 2025

Total time taken to generate the page: 0.07998 seconds