-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_fac_affil.py
23 lines (23 loc) · 1.19 KB
/
gen_fac_affil.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import csv
with open('csrankings.csv', mode='r') as infile:
reader = csv.DictReader(infile)
with open('industry.csv', mode='r') as infile2:
reader2 = csv.DictReader(infile2)
with open('my_extra.csv', mode='r') as infile3:
reader3 = csv.DictReader(infile3)
with open('faculty-affiliations.csv', 'w') as facultyaffs:
facfieldnames = ['name', 'affiliation']
facWriter = csv.DictWriter(facultyaffs, fieldnames=facfieldnames)
facWriter.writeheader()
for row in reader:
f = { 'name' : row['name'].strip().rstrip(),
'affiliation' : row['affiliation'].strip().rstrip() }
facWriter.writerow(f)
for row in reader2:
f = { 'name' : row['name'].strip().rstrip(),
'affiliation' : row['affiliation'].strip().rstrip() }
facWriter.writerow(f)
for row in reader3:
f = { 'name' : row['name'].strip().rstrip(),
'affiliation' : row['affiliation'].strip().rstrip() }
facWriter.writerow(f)