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
{{ message }}
Repository navigation
fread fails with double quotes at the beginning of a field #1077
The CRAN (1.9.4) version of data.table silently ignores this issue and returns and empty object:
fread('2,3\n""foo,bar')
## Empty data.table (0 rows) of 1 col: "foo,bar
The development version (32975cd) fails with an error:
fread('2,3\n""foo,bar')
## Error in fread("2,3\n\"\"foo,bar") : ## Field 1 on line 2 starts with quote (") but then has a problem. It can contain balanced unescaped quoted subregions but if it does it can't contain embedded \n as well. Check for unbalanced unescaped quotes: ""foo,bar
I'm aware of the fact that this "CSV" is not well formed, but that's what I get :( Is there a way to sepcify something like quote=''?
Thanks for the report. quote = "" is implemented. Either use that, or wrap your file with "" around character columns so that quote = "\"" can then read it properly. See ?fread quote argument.
Activity
arunsrinivasan commentedon Sep 8, 2015
Thanks for the report.
quote = ""is implemented. Either use that, or wrap your file with""around character columns so thatquote = "\""can then read it properly. See?freadquote argument.daroczig commentedon Sep 8, 2015
Awesome, thank you very much, @arunsrinivasan & keep up the good work 💯
arunsrinivasan commentedon Sep 16, 2015
Removed quote argument with a better fix (slightly more robust) for quotes. Please upgrade and test.
daroczig commentedon Sep 16, 2015
Thanks! For the record, related commit: 9cb1f60