-
Notifications
You must be signed in to change notification settings - Fork 0
/
processComments.py
executable file
·31 lines (30 loc) · 1000 Bytes
/
processComments.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#f = open("processedComments.csv","a")
f = open("processedCommentsID.csv","w")
f.write("university | postID | Post | Username | Time | CommentID| Comment|Viable Ans?|Mean Post|Taboo?|Stigma?|Stigma type?|inter w/ OP|inter w/ com||||||||\n")
'''
for num in range(1,4):
lines = open("comments"+str(num)+".csv").readlines()[1:]
for line in lines:
uni = line.split("|")[0]
if "Davis" in uni:
continue
f.write(line)
for num in range(4,7):
lines = open("comments"+str(num)+".csv").readlines()[1:]
for line in lines:
org = line.rsplit("|",7)
line = org[0]+"|"+org[2]+"|"+org[3]+"|"+org[4]+"|"+org[5]+"|"+org[6]+"|"+org[7]
uni = line.split("|")[0]
if "Davis" in uni:
continue
f.write(line)
'''
for num in range(7,9):
lines = open("comments"+str(num)+".csv").readlines()[1:]
for line in lines:
#org = line.rsplit("|",8)
#line = org[0]+"|"+org[3]+"|"+org[4]+"|"+org[5]+"|"+org[6]+"|"+org[7]+"|"+org[8]
uni = line.split("|")[0]
if "Davis" in uni:
continue
f.write(line)