2

I have a csv file which sep="\t", quote=TRUE, so the data is quoted like "2011-01-11"

I used the following script to import the csv file into R

temp <- sqldf("select * from dummy limit 10",file.format=list(header=TRUE,sep="\t",quote="\""))

But it gives me something like "\"2011-01-11\""

The \" is the extra thing in each cell that I want to get rid of, how can I do it? Thanks.

lokheart
  • 23,743
  • 39
  • 98
  • 169

2 Answers2

3

Its a FAQ: How does one deal with quoted fields in read.csv.sql?

G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341
0

I am not familiar with sqldf, but there must be a better way importing your dataset. However, an answer to your question:

x <- c("\"2011-01-11\"")
gsub("\\\"", "", x)
Mikko
  • 7,530
  • 8
  • 55
  • 92