Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Attempts to merge an unlimited number of txt that you specify.
import time
import random
def getnumber():
while True:
x = input("Insert the number of transcripts you wish to merge: ")
try:
x = int(x)
except:
continue
break
return x
def merger(x):
file = []
for sten in range(0,x):
txt = input("Input the name of the transcript you wish to merge: ")
file.append(txt)
filelength = len(file)
filenum = 0
new = open("MergedTranscript.txt","w")
stringing = False
for steno in range(0,filelength):
if stringing == False:
pass
else:
next.close()
new.write(stringing)
new.write("""
""")
next = open(file[filenum],"r")
stringing = next.read()
filenum += 1
next.close()
new.write(stringing)
new.write("""
""")
new.close()
return None
fingers = getnumber()
keys = merger(fingers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment