Last active
August 29, 2015 14:17
-
-
Save lukasmartinelli/6cb0bd2dc01cea918998 to your computer and use it in GitHub Desktop.
Fix missing quotes in 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
import fileinput | |
import re | |
import sys | |
if __name__ == "__main__": | |
for line in fileinput.input(): | |
m = re.match(r"(.*/.*) (.*) (\d*)", line) | |
if m: | |
print('"{0}","{1}",{2}'.format(m.group(1), | |
m.group(2), | |
m.group(3))) | |
else: | |
sys.stderr.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment