This is to take text from a file and combine with a string to print to a new file for a combined result
file = open('/home/user/facts', 'r')
result = open('/home/user/result.txt', 'a')
i = 1
for line in file:
print >>result, "fact_text[%d] = \"%s\";"% (i, line)
i += 1
For some reason the "; is showing up on a separate line, and I do not know why. Thanks in advance.