Created
October 30, 2020 15:05
-
-
Save jorvis/b4f8fd439bbdfd8a1f4df96e154334e0 to your computer and use it in GitHub Desktop.
Eve survey scanner parser
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 sys | |
from collections import defaultdict | |
infile = sys.argv[1] | |
sums = defaultdict(int) | |
for line in open(infile): | |
line = line.rstrip() | |
cols = line.split("\t") | |
ore = cols[0] | |
volume = int(cols[2].replace(' m3', '').replace(',', '')) | |
sums[ore] += volume | |
for ore in sums: | |
print("{0} - {1} m3".format(ore, sums[ore])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output looks like this: