I have a csv file that most of the time starts with a date, but sometimes with text. So f.E:
time user text
2019-01-01T00:09:59-05:00: user1: text1
2019-01-01T00:09:59-05:00: user1: text4
2019-01-01T00:10:10-05:00: operator: error \
ERRCODE: error 'operator' info.
2019-01-01T00:09:59-05:00: user2: text5
As you can see, sometimes there's an error that gets logged in a new line. I want to read this into a pandas DF, and convert the first column into date format. However, ERRCODE
s mess it up. Can I somehow read the file conditionally (I have loads of data, so speed is a concern) so that if the row does not start with a date, it gets concatenated into the previous row's text
column?