Skip to content
Snippets Groups Projects
Commit 32cac421 authored by Victor Zimmermann's avatar Victor Zimmermann
Browse files

Add program to merge output files for single target words.

parent 306e1df9
No related branches found
No related tags found
No related merge requests found
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment