Skip to content

Instantly share code, notes, and snippets.

@jorvis
Created October 30, 2020 15:05
Show Gist options
  • Save jorvis/b4f8fd439bbdfd8a1f4df96e154334e0 to your computer and use it in GitHub Desktop.
Save jorvis/b4f8fd439bbdfd8a1f4df96e154334e0 to your computer and use it in GitHub Desktop.
Eve survey scanner parser
#!/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]))
@jorvis
Copy link
Author

jorvis commented Oct 30, 2020

Output looks like this:

$ ./parse_survey_scan.py survey.scan 
Concentrated Veldspar - 10547 m3
Condensed Scordite - 33284 m3
Dense Veldspar - 1704 m3
Massive Scordite - 32991 m3
Pyroxeres - 67308 m3
Scordite - 67788 m3
Solid Pyroxeres - 21147 m3
Veldspar - 47234 m3
Viscous Pyroxeres - 8330 m3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment