Uhm, if the file is clean you can use something like this:

data = """\
200501221530
John
*** long string here ***

200504151625
Clyde
*** clyde's long string here ***

200503130935
Jeremy
*** jeremy string here ****"""

records = [rec.split("\n") for rec in data.split("\n\n")]
records.sort()
print records

If it's not clean, you have to put some more cheeks/cleanings.

Bye,
bearophile

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

Reply via email to