Created
July 31, 2018 08:05
-
-
Save uggedal/a1b90f36ab34d5e340663001499fb350 to your computer and use it in GitHub Desktop.
Convert Nordic Choice bonus list to CSV
This file contains hidden or 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 python | |
import sys | |
with open(sys.argv[1]) as f: | |
i = 0 | |
date = None | |
name = None | |
points = None | |
for l in f.readlines(): | |
i += 1 | |
v = l.strip().replace(',', '') | |
if i == 1: | |
date = v | |
if i == 3: | |
name = v | |
if i == 5: | |
points = v.replace('BP.', '').replace(' ', '') | |
if i == 6: | |
print(','.join([date, name, points])) | |
i = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment