I am trying to split a dataframe column into multiple columns based on a delimiter. My dataframe has one column which looks like below-
A0017493 .A 11.86 23:59_10/10/2016 1.00 SURVEYED
A0017493 .A 11.86 23:59_10/11/2016 1.15 DATALOGGER CHANGED
A0017496 .A 11.82 23:59_11/12/2016 2.06 READING IS WRONG
I want a dataframe which has 6 columns namely Site, File, Variable, Timestamp, Value, and Comment, like below-
Site File Variable Timestamp Value Comment
A0017493 .A 11.86 23:59_10/10/2016 1.00 SURVEYED
A0017493 .A 11.86 23:59_10/11/2016 1.15 DATALOGGER CHANGED
A0017496 .A 11.82 23:59_11/12/2016 2.06 READING IS WRONG
I tried to do this by using tidyr package and using the 'separate' statement because each observation is delimited by a space. However, the problem is that the comments have spaces in between them and I don't want to split the comments. Is there a way to do this? Any help will be greatly appreciated. Thanks!