Skip to content

Instantly share code, notes, and snippets.

@retorquere
Created January 17, 2019 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retorquere/3d572d75e6c85c18edd445c33bb07e2e to your computer and use it in GitHub Desktop.
Save retorquere/3d572d75e6c85c18edd445c33bb07e2e to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
with open(sys.argv[2], 'w') as tgt:
with open(sys.argv[1]) as src:
for line in src.readlines():
if line.startswith('TI -') or line.startswith('TI-'):
tgt.write('TY - JOUR\n')
elif line.startswith('TM'):
line = 'N1' + line[2:]
tgt.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment