<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 04/11/2011 12:32 PM, John Lee wrote:
<blockquote
cite="mid:BANLkTinLGYyQAADbqZ=OT-gyTYeNbpHz6A@mail.gmail.com"
type="cite">Need to read the last 4 lines (txt) of a very large
log file 100M bytes, 100k lines or more lots of times - of course
I can read through the file in the normal way but this is rather
slow. Is there a way to 'read lines from the end'? I note that
unix tail or its port to windows does this very fast so guess
there must be a fast way to do it in pascal too?
<div>
<br>
</div>
<div>TIA for any ideas John</div>
<div>
<div><br>
</div>
<div> <br>
<div><br>
</div>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a></pre>
</blockquote>
<br>
Hmm, could first have the reader enumerate the number of lines in
the file, then read through the files using the "total number of
lines - 4" variable and then start displaying the lines after that
variable has been reached. If necessary, I would be happy to see
what I can come up with here and then post it to the mailing list.<br>
</body>
</html>