Skip to content

Instantly share code, notes, and snippets.

@araastat
Created December 6, 2013 07:38
Show Gist options
  • Save araastat/7819978 to your computer and use it in GitHub Desktop.
Save araastat/7819978 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import re
f = open('Bibliography_ToddArnedtGrant.txt','r')
Todd = f.readlines()
f.close()
f = open('Bibliography_SoniaDuffyGrant.txt','r')
Sonia = f.readlines()
f.close()
f = open('Bibliography_LymphedemaContract.txt','r')
Lymph = f.readlines()
f.close()
Sonia = [u.lstrip('\t') for u in Sonia]
author = sys.argv[1]
number = sys.argv[2]
refs = {'Todd':Todd, 'Sonia':Sonia, 'Lymph':Lymph}
out = [u for u in refs[author] if u.split('.')[0]==str(number)]
out1 = out[0].split('.')[1].replace('\t','')
out2 = re.findall('\d{4}',out[0])
out = [out1,out2]
print out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment