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
  • 47,396
  • 5
  • 31
  • 61
Srikanth
  • 219
  • 2
  • 3
  • 15

0 Answers0