Skip to content

Instantly share code, notes, and snippets.

@ypcrts
Created August 1, 2018 16:53
Show Gist options
  • Save ypcrts/0291533f700dfa09c9b1e7b1e2940d9e to your computer and use it in GitHub Desktop.
Save ypcrts/0291533f700dfa09c9b1e7b1e2940d9e to your computer and use it in GitHub Desktop.
dcc2
#!/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()
@ypcrts
Copy link
Author

ypcrts commented Aug 1, 2018

awk / bawk / gawk is dead

verbose python ftw

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