Skip to content

Instantly share code, notes, and snippets.

@ericjang
Created May 30, 2012 05:24
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 ericjang/2833931 to your computer and use it in GitHub Desktop.
Save ericjang/2833931 to your computer and use it in GitHub Desktop.
quick and dirty parsing for naviance college admission results
#script for parsing Mrs. Cao's file.
import csv
original = csv.reader(open('/Users/Eric/Desktop/destinations.csv','rU'))
f = open('/Users/Eric/Desktop/formattedList.txt', 'w')
current = ""
for row in original:
college = row[2]
if college != current:
f.write('\n' + college + '\n--------------\n')
current = college
#format the name
name = row[0].split(', ')[1] + ' ' + row[0].split(', ')[1]
f.write(name+'\n')
else:
#same college as previous
name = row[0].split(', ')[1] + ' ' + row[0].split(', ')[0]
f.write(name+'\n')
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment