Created
July 9, 2014 23:41
-
-
Save cigrainger/fe0c66eeb7f97a0838c0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import re | |
| pattern=re.compile(r'[^1-9 ]') | |
| ids = [] | |
| with open('abstractids.txt','r') as f: | |
| for line in f: | |
| line = pattern.sub('',line) | |
| ids.append(line) | |
| with open('abstractsfinal.txt','r') as f: | |
| i = 0 | |
| for line in f: | |
| title = './abstracts/'+ids[i]+'.txt' | |
| with open(title,'w') as f1: | |
| f1.write(line) | |
| print i | |
| i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment