From: Thomas Preymesser Date: 2008-12-21T01:46:25+09:00 Subject: Re: get first and last line from txt file - how? 2008/12/20 Yaser Sulaiman : > I'm just wondering.. > Let's say that we only need to read the last line. Can we do that without > reading the other lines? Yes. Position your file pointer to the last byte in a file, read and collect backwards each byte until you find a newline character (or the first byte of the file). This is the last line. -Thomas -- Thomas Preymesser thopre@gmail.com http://thopre.googlepages.com/ http://thopre.wordpress.com/