0

I have a "|" separated dataset which I am not able to import in R as such and hence I am trying to convert all "|" to "," so that I can import the dataset as csv.

I tried doing this

gsub("|", ",", Dataset$V1)

But the replacement is done wrong by R. For example if I have

string|a|b

I want it to be

string,a,b

But it is getting converted to

s,t,r,i,n,g,|,a,|,b

What is the solution ?

Please suggest even if there are any way to import the "|" separated .DEL file in R.

Sotos
  • 51,121
  • 6
  • 32
  • 66
Srikanth
  • 237
  • 2
  • 4
  • 16

0 Answers0