Here is the sample dataset. Here the problem is the seperator is ::
but inbetween the movie name there is :
so I am getting problem with this.
Please help me out.
Asked
Active
Viewed 190 times
-1

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

naveen
- 1
- 3
-
2Do not post your data as an image, please learn how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610) – Jaap Sep 28 '16 at 14:08
1 Answers
0
You could try to do the following:
require(data.table)
input <- data.table(do.call(rbind,strsplit(readLines('file.txt'),'::' )))
input[, c("V3", "V4", "V5") := tstrsplit(V3, split = "|", fixed = T)]
The first line reads your file ("file.txt" should be substituted with your file name) using the :: as a separator. The second line splits the 1 column that contains all the classifications into 3 separate columns.