I wrote a script in python a few years ago and havent since used python at all. The script joins text files together into a larger text file. The old text files were the same length and so i could indicate the lines i wanted to append onto the large text file. I now would like to make a larger text file from text files of varying lengths.
I realise this is a simple edit but everything i have tried has not worked. Can somebody point me in the right direction?
- Code: Select all
# Name: xxxxxx
# Author: xxxxxx
g = open('./data/EPRI_all.log', 'a')
for p in os.listdir('./data/'): ######
if '.txt' in p and p[0:2] == 'Se':
lines = 
for line in open('./data/%s' % p, 'r'):