I want to take lines of text from a .txt file and copy it to the bottom of an existing word doc. i have something that does this from one text file to another but the overall goal is to copy it to the bottom of a word document for a report.
I am using python 2.6 and currently have
with open('Error.txt', 'w') as f1:
for line in open('2_axis_histogram.txt'):
if line.startswith('Error'):
f1.write(line)
else:
f1.write("No Error ")
f1.close()
I have no idea about how i could then transfer this to word.
Also, when there is no error and the else condition is used, it prints out the "No Error" loads of times whereas i just need it to print that statement once.