I use the following code segment to read a file in python:
with open (\"data.txt\", \"r\") as myfile: data=myfile.readlines()
Input fil
It's hard to tell exactly what you're after, but something like this should get you started:
with open ("data.txt", "r") as myfile: data = ' '.join([line.replace('\n', '') for line in myfile.readlines()])