I got a text file with data I want to read, but one of the columns is a messy "code" which contains the same character used as the separator. Take the following set as an example:
number:string
1:abc?][
2:def:{+
There will be a line with 3 columns and only 2 column names. Is there any strategy to read this dataset?
Good old
regular expressions
should help you with thisRead txt file
The
data.frame
will be one column, so we will need to split it based on some patternCreate the columns