Fast access to text files by line number.
Quickly access arbitrary line numbers in a text file. A well tested library for Python 3.
- with IndexedOpen(‘big_text_file.txt’) as f:
- print(f[35234:35300]) # happens fast
Does this by creating index files on demand of the locations of lines in a file. The first call to a file is slow but subsequent calls are very quick.