On 03/31/2013 01:52 PM, Charlie Kester wrote:
I'd read the file one character at a time, counting newlines, until I reached the desired line. [..] Doing it this way avoids the need for a buffer altogether, along with any guessing about possible line lengths.
Reading is expensive. Loop through an optimally sized buffer and incrementally count newlines.

Reply via email to