Newbie help with manipulating text files
William Dandreta
wjdandreta at worldnet.att.net
Fri May 25 19:56:14 EDT 2001
More information about the Python-list mailing list
Fri May 25 19:56:14 EDT 2001
- Previous message (by thread): Newbie help with manipulating text files
- Next message (by thread): Newbie help with manipulating text files
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi jk,
Here is a different way:
lines = file.readlines()
counter = 0
(headerlist,middlelist,footerlist) = ([],[],[])
for line in lines:
if line[:6] == 'middle':
middlelist += line
counter += 1
elif: counter == 0: headerlist += line
else: footerlist += line
middlelist.sort()
wholelist = headerlist + middlelist + footerlist
bill
- Previous message (by thread): Newbie help with manipulating text files
- Next message (by thread): Newbie help with manipulating text files
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list