Below is the python script:
import os
from glob import iglob
rootdir_glob = 'D:/FileZilla Data/New 21112019/Raw Data/New folder/ThaiLand' # Note the added asterisks
file_list = [f for f in iglob('D:/FileZilla Data/New 21112019/Raw Data/New folder/ThaiLand/**/*', recursive=True) if os.path.isfile(f)]
results = 'final.txt'
with open('combined_app', "wb") as wfd:
for f in file_list:
if (f.find('RealLifeApp.txt') != -1):
print(f)
data = open(f)
out = open(results,'a')
for l in data:
print(l,file=out)
data.close()
out.close()
Below is the error i get.
I have no control over the .txt file in regards to making changes.
Is there any way to fix this error or maybe another way to merge the .txt files.
Thanks!