in reply to Fast way to read from file

hm, donīt know if it helps, but i use this nice one liner:

perl -e'open(FL,"primes.txt");$. == 10000 && ($line = $_) while <FL>;print("$line\n");'

it takes < 1 sec. to find the 10,000th line and uses very few memory.