Seek the one billionth line in a file containing 3 billion lines.

Méta-MCI (MVP) enleverlesX.XmcX at
Wed Aug 8 09:54:26 CEST 2007


Create a "index" (a file with 3,453,299,000 tuples : 
line_number + start_byte) ; this file has fix-length lines.
slow, OK, but once.

Then, for every consult/read a specific line:
  - direct acces read on index
  - seek at the fisrt byte of the line desired


Michel Claveau

More information about the Python-list mailing list