Created
August 1, 2018 16:53
-
-
Save ypcrts/0291533f700dfa09c9b1e7b1e2940d9e to your computer and use it in GitHub Desktop.
dcc2
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/python | |
import sys | |
fp = open(sys.argv[1], 'r') | |
fo = open(sys.argv[1] + ".done", 'w') | |
while True: | |
line = fp.readline().strip() | |
if not line: | |
break | |
ele = line.split(":") | |
fo.write("$DCC2$10240#"+ele[0]+"#"+ele[1]+"\n") | |
fo.flush() | |
fp.flush() | |
fo.close() | |
fp.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awk / bawk / gawk is dead
verbose python ftw