This example:
require(data.table)
DT = data.table(A=rep("abc", 10000), B="def")
DT[110, A:='"a"b']
fwrite(DT, f<-tempfile(), quote=F)
fread(f)
produces an error message which is misleading:
Expecting 2 cols but row 0 contains only 1 cols (sep=','). Consider fill=true. <<"a"b,def>>
At least it doesn't crash (which I thought it would given that type[0]
gets bumped up from CT_STRING
into a non-existent type)...
Possible approach:
1,foo,"","bar",,"baz,baz"
, while these are not: "foo""bar","foo\"bar",foo"bar,f"oo,bar"
.QR0 -> {QR1|QR2|QR3} -> QR4
.I'm running into this too, but getting an error.
fread("foo.csv", select=c("Date", "Description", "Amount"), header = T) # error
fread("foo.csv", header = T, verbose = F) # works
@ben519 Your dataset contains just 1 row, so it's definitely not because of out-of-sample irregularities. I've created a new issue for your error (see link above)
Most helpful comment
@ben519 Your dataset contains just 1 row, so it's definitely not because of out-of-sample irregularities. I've created a new issue for your error (see link above)