Skip to content

Instantly share code, notes, and snippets.

@retorquere
Created January 17, 2019 23:02
#!/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