Stefan Behnel wrote:
> [EMAIL PROTECTED] wrote:
>>> What are you going to do with it after it's sorted?
>> I need to isolate all lines that start with two characters (zz to be
>> particular)
> 
> "Isolate" as in "extract"? Remove the rest?
> 
> Then why don't you extract the lines first, without sorting the file? (or sort
> it afterwards if you still need to). That would heavily cut down your memory
> footprint.

Just for fun, this is what I meant:

    for utf8_line in open(filename, 'rb'):
        if utf8_line.startswith('zz'):
            print utf8_line

Stefan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to