-
-
Save egonw/798b9a3813ee094aa155a4dff44eef0f to your computer and use it in GitHub Desktop.
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 | |
from sys import stdin, stdout | |
import csv | |
rdr = csv.reader(stdin, delimiter='\t') | |
wrt = csv.writer(stdout, delimiter='\t') | |
vals = [] | |
rows = [] | |
for row in rdr: | |
val = row[0] | |
val = val.replace(',','.').replace('K', '*1000').replace('M', '*1000000').replace('G', '*1000000000') | |
exec('val=' + val) | |
vals.append(val) | |
rows.append(row) | |
max = max(vals) | |
for v, r in zip(vals,rows): | |
fname = r[1] | |
graph = ('*'*round((v / max) * 100)) | |
print(fname.rjust(64), graph, r[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment