简体   繁体   中英

Import data csv with particular quotes in R

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.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM