concat data for final stuff
This commit is contained in:
parent
f0f2647b39
commit
f1060e47af
5106
expanded_data_final.csv
Normal file
5106
expanded_data_final.csv
Normal file
File diff suppressed because it is too large
Load Diff
22
text_pp.py
22
text_pp.py
@ -2,7 +2,7 @@ import os
|
|||||||
import csv
|
import csv
|
||||||
import json
|
import json
|
||||||
|
|
||||||
path = '/data/users/mgaughan/kkex_comment_data_120523/'
|
path = '/data/users/mgaughan/kkex_comment_final/'
|
||||||
empty_file_dict = {'data': {'repository': {'issues': {'edges': []}}}}
|
empty_file_dict = {'data': {'repository': {'issues': {'edges': []}}}}
|
||||||
|
|
||||||
|
|
||||||
@ -22,10 +22,8 @@ def check_files_for_content(filelist):
|
|||||||
os.remove(filepath)
|
os.remove(filepath)
|
||||||
opened_file.close()
|
opened_file.close()
|
||||||
continue
|
continue
|
||||||
list_of_issues= file_contents['data']['repository']['issues']['edges']
|
#list_of_issues= file_contents['data']['repository']['issues']['edges']
|
||||||
handle_repo_issues(list_of_issues)
|
#handle_repo_issues(list_of_issues)
|
||||||
if x > 7:
|
|
||||||
break
|
|
||||||
#print(bad_data_files)
|
#print(bad_data_files)
|
||||||
|
|
||||||
def handle_repo_issues(list_of_issues):
|
def handle_repo_issues(list_of_issues):
|
||||||
@ -42,6 +40,18 @@ def handle_issue_comments(list_of_comments):
|
|||||||
print("------------------")
|
print("------------------")
|
||||||
print(comment_body)
|
print(comment_body)
|
||||||
|
|
||||||
|
def concat_csv():
|
||||||
|
with open("121223_expanded_data.csv", "r") as f1:
|
||||||
|
first_block = f1.read()
|
||||||
|
with open("121323_expanded_data.csv", "r") as f2:
|
||||||
|
second_block = f2.read()
|
||||||
|
with open("expanded_data_final.csv", "w") as f3:
|
||||||
|
f3.write(first_block)
|
||||||
|
f3.write("\n")
|
||||||
|
f3.write(second_block)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
check_files_for_content(os.listdir(path))
|
#check_files_for_content(os.listdir(path))
|
||||||
|
concat_csv()
|
Loading…
Reference in New Issue
Block a user