Text processing and file creation
James Stroud
jstroud at mbi.ucla.edu
Wed Sep 5 14:23:04 EDT 2007
malibuster at gmail.com wrote:
> 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?
You should use a nested loop.
> In advance, thanks for your help.
>
You're welcome.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
More information about the Python-list
mailing list