I have text data as given below:
\r\n \r\n How to get a confirm ticket?\r\n \r\n I want to get a tatkal ticket confirm ...
How to extract two columns from this data?
I have tried str_split_fixed() which divide into four columns and after those four column, two column can be retrieved ... But I want that straight forward it gives only two columns.
x <- "\r\n \r\n How to get a confirm ticket?\r\n \r\n I want to get a tatkal ticket confirm ..."
str_split_fixed(x, "\r\n", 4)
#> [,1] [,2] [,3] [,4]
#> [1,] "" " " " How to get a confirm ticket?" " \r\n I want to get a tatkal ticket confirm ..."
str_split_fixed(x, "\r\n", 4)[1, 3]
#> [1] " How to get a confirm ticket?"