dunno if this makes sense, but it prints all the lines from the flat file 'CLIENTS.CSV' where the first letter is L
I am sure there are easy ways - but it's all I could think of on the spur of the moment.
I tried it on a 24mb client file and it only took a second to work out (took ages to display it to screen)
Peter
file = file('d:\\CLIENTS.CSV').readlines()
startline, endline, counter = 0, 0, 0
for line in file:
counter = counter +1
if line.startswith('L') and startline==0:
startline = counter
endline = counter
if line.startswith('M') and startline==endline:
endline = counter
print file[startline:endline]