Hi Arivoli,
Theres a dirty trick ;) (by running a command).. If u r on a linux machine u
can use the tail command .. tail -100 <filename> would give u the last 100
lines of <filename> ..
(or do a seek and read)
or u can try this http://code.google.com/p/pytailer/
Regards,
Vimal
----- Original Message ----
From: Arivoli S <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, April 4, 2008 11:29:40 PM
Subject: [BangPypers] How to read a file from bottom
Hi everybody,
i have a log file which will grow everyday, so the size will be nearly
500MB. i am keep on inserting a line one by one in the file.
so the latest one will be in the bottom. I need to get latest 100 lines(lines
from bottom). Any idea how to read lines from bottom in a text file?
I tried storing into a list line by line, and iterating from bottom , but it
seems to be slow. Is there any better way to do this?
thanks
Arivoli
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total
Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers