You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, if i'm understanding things correctly, any values that match sep= inside a quoted field will derail a dbWriteTable() import from a file connection?
library(DBI)
tf <- tempfile()
x <- c( '"header1","header2"' , '"one,two","three"' )
writeLines( x , tf )
db <- dbConnect( RSQLite::SQLite() )
# works as expected
read.csv( tf )
# fails
dbWriteTable( db , 'x' , tf )
and delimited files with quotes carry those quotes into the column values.. thanks for considering this!
y <- c( '"header1","header2"' , '"onetwo","three"' )
writeLines( y , tf )
dbWriteTable( db , 'y' , tf )
# with quotes
dbReadTable( db , 'y' )[1,1]
# without quotes
read.csv( tf )[1,1]
The text was updated successfully, but these errors were encountered:
Thanks. The code that implements this is "legacy" C code (taken from SQLite's shell.c), and there's no support for quoting in that code. Please load the data into a data frame and use the data frame method for now.
We could e.g. take code from readr and adapt it to store data in the database, avoiding the roundtrip to R.
hi, if i'm understanding things correctly, any values that match
sep=
inside a quoted field will derail adbWriteTable()
import from a file connection?and delimited files with quotes carry those quotes into the column values.. thanks for considering this!
The text was updated successfully, but these errors were encountered: