http://qs321.pair.com?node_id=433658


in reply to Displaying/buffering huge text files

Instead of indexing every single line, you could index a fraction of them (say every 10th or every 25th) and just skip a few lines after seeking.

If they want to see line 57, seek to line 50 using your index, and skip 7 lines after reading.

Replies are listed 'Best First'.
Re^2: Displaying/buffering huge text files
by spurperl (Priest) on Feb 23, 2005 at 15:57 UTC
    This is an excellent idea - I'll definitely keep it in mind. For now, it looks that full indexing is good enough, but I may stumble upon corner cases...