Import data csv with particular quotes in R

31 Views Asked by At

I have a csv like this:

"Data,""Ultimo"",""Apertura"",""Massimo"",""Minimo"",""Var. %"""
"28.12.2018,""86,66"",""86,66"",""86,93"",""86,32"",""0,07%"""

What is the solution for importing correctly please? I tried with read.csv("IT000509408=MI Panoramica.csv", header=T,sep=",", quote="\"") but it doesn't work.

1

There are 1 best solutions below

0
Danny_ds On

Each row in your file is encoded as a single csv field.

So instead of:

123,"value"

you have:

"123,""value"""

To fix this you can read the file as csv (which will give you one field per row without the extra quotes), and then write the full value of that field to a new file as plain text (without using a csv writer).