import os
currentDirectory = os.getcwd()
textFiles = []
for f in os.listdir(currentDirectory):
if (f.endswith('.txt') or f.endswith('.TXT')) and (f != 'output.txt'):
textFiles.append(f)
d = {}
for tf in textFiles:
cf = open(tf, "r")
for line in cf:
line = line.strip('\n') + '\n'
d[line] = 0
cf.close()
wf = open("output.txt", "w")
wf.writelines(d)
Hey Dude,
Use this python script to do your job. It's pretty easy !
Code:import os currentDirectory = os.getcwd() textFiles = [] for f in os.listdir(currentDirectory): if (f.endswith('.txt') or f.endswith('.TXT')) and (f != 'output.txt'): textFiles.append(f) d = {} for tf in textFiles: cf = open(tf, "r") for line in cf: line = line.strip('\n') + '\n' d[line] = 0 cf.close() wf = open("output.txt", "w") wf.writelines(d)