Created
May 30, 2012 05:24
-
-
Save ericjang/2833931 to your computer and use it in GitHub Desktop.
quick and dirty parsing for naviance college admission results
This file contains 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
#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