Created
October 19, 2012 22:23
-
-
Save kirelagin/3921048 to your computer and use it in GitHub Desktop.
Sort cvk2012 voters list by registration date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import csv | |
from datetime import datetime | |
import sys | |
DATE_FORMAT='%d.%m.%Y %H:%M:%S' | |
if __name__ == '__main__': | |
reader = csv.reader(sys.stdin, delimiter=';') | |
rows = sorted(reader, key=lambda v: datetime.strptime(v[1], DATE_FORMAT)) | |
for v in rows: | |
print(';'.join(v)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment