let's do it properly
import csv with open('170825 t05 L11O44S3.txt', encoding='utf-16') as f: rdr = csv.reader(f, delimiter='\t') for line in rdr: print(line)each line will turn to 2-element list. you can join them together again or use separately
Output:['25 August 2017 09:15:00', '23.19']
['25 August 2017 09:00:00', '22.98']
['25 August 2017 08:45:00', '22.76']
['25 August 2017 08:30:00', '22.62']
['25 August 2017 08:15:00', '22.41']
['25 August 2017 08:00:00', '22.34']
....
or if you prefer single listimport csv with open('170825 t05 L11O44S3.txt', encoding='utf-16') as f: rdr = csv.reader(f, delimiter='\t') data = [' '.join(line) for line in rdr] print(data)
Output:['25 August 2017 09:15:00 23.19', '25 August 2017 09:00:00 22.98', '25 August 2017 08:45:00 22.76', '25 August 2017 08:30:00 22.62', '25 August 2017 08:15:00 22.41',...]
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs