On Jun 17, 8:10 pm, Patrick David <[EMAIL PROTECTED]>
wrote:
> Hello NG,
>
> I am searching for a way to jump to a specific line in a text file, let's
> say to line no. 9000.
> Is there any method like file.seek() which leads me to a given line instead
> of a given byte?

If by "jump" you mean without reading the preceding 8999 lines, and by
"text file" you mean variable length records without a separate index
structure, that method hasn't been implemented yet. AFAIK it hasn't
been implemented in any other language either :-)

The linecache module may be what you want, depending on how closely
your access patterns match those the module was designed for.

Cheers,
John
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to