diff --git a/code/result_merger.py b/code/result_merger.py new file mode 100644 index 0000000000000000000000000000000000000000..5c7c207fc5e3d68de9c3d7d514b1363c0c2c010f --- /dev/null +++ b/code/result_merger.py @@ -0,0 +1,23 @@ +import os + +file_path = '/home/students/zimmermann/Courses/ws17/fsem/absinth/clustering/' + +files = [file_path+'/'+f for f in os.listdir(file_path)] + +results = list() + +for f in files: + with open(f, 'r') as lines: + for line in lines.readlines()[1:]: + results.append(line.split('\t')) + +sorted(results, key=lambda x: x[0]) + +final = open('final.txt', 'w') + +final.write('subTopicID\tresultID\n') + +for r in results: + final.write('\t'.join(r)) + +final.close()