Text processing and file creation

Arnau Sanchez arnau at ehas.org
Wed Sep 5 12:30:27 EDT 2007


malibuster at gmail.com escribió:

> I have a text source file of about 20.000 lines.
>>From this file, I like to write the first 5 lines to a new file. Close
> that file, grab the next 5 lines write these to a new file... grabbing
> 5 lines and creating new files until processing of all 20.000 lines is
> done.
> Is there an efficient way to do this in Python?

Perhaps you could provide some code to see how you approached it?



More information about the Python-list mailing list