Created
March 25, 2019 21:55
-
-
Save vmiheer/5d87bb75b6e4c177d53d924ebb46e39c to your computer and use it in GitHub Desktop.
Convert pin output to csv
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
""" | |
Pin output to csv | |
""" | |
import sys | |
import re | |
import argparse | |
startOfDynamicSection = False | |
outFile = open(sys.argv[2], 'w') | |
for line in open(sys.argv[1]): | |
if line == "# $dynamic-counts\n": | |
startOfDynamicSection = True | |
if not startOfDynamicSection: | |
continue | |
if line[0] == '#': | |
continue | |
outFile.write(re.sub(r"^[ ]*(\d+)[ ]+([^ ]+)[ ]+(\d+).*$", r"\1,\2,\3", line)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment