Skip to content

Instantly share code, notes, and snippets.

@cigrainger
Created April 9, 2014 15:54
Show Gist options
  • Select an option

  • Save cigrainger/10285687 to your computer and use it in GitHub Desktop.

Select an option

Save cigrainger/10285687 to your computer and use it in GitHub Desktop.
import re, string
pattern=re.compile('[\W_]+')
f = open("C:\Users\graingec\spillovers\\abstracts\\abstracts.csv","rb")
abstracts = []
for line in f:
y = line.split(',',1)
if len(y)==2:
c = pattern.sub('',y[1].lower())
abstracts.append(c)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment