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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4