----- Editing answer to account for inconsistent spacing:
Not sure what the pythonic approach should be, but here's a method that could work.
Using OP's data sample as an example:
0 date=2015-09-17 time=21:05:35 duration=0
1 date=2015-09-17 time=21:05:36 duration=0
2 date=2015-09-17 time=21:05:37 duration=0
3 date=2015-09-17 time=21:05:38 duration=0
4 date=2015-09-17 time=21:05:39 duration=0
5 date=2015-09-17 time=21:05:40 duration=0
I loop through each line and split at the equals sign, then grab the desired text:
import pandas as pd
log_data = open('log_sample.txt', 'r')
split_list = []
for line in log_data:
thing1 = line.split('=')
#print(thing1)
date = thing1[1][:10]
time = thing1[2][:8]
dur = thing1[3]
split_list.append([date, time, dur])
df = pd.DataFrame(split_list, columns=['date', 'time', 'duration'])
df
----- First Answer:
As @jezrael mentions in the comments, you can leverage the "sep" argument within read_csv.
pd.read_csv('test.txt', sep=r'\\t', engine='python') #[1]
See: