Here's the proper (at least it does not crash R) error message (I've shortened all the words and it made fread to work):
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.2.0 (64-bit)
> library(data.table)
data.table 1.9.3 For help type: help("data.table")
> fread('fails_with_proper_error.csv')
Error in fread("fails_with_proper_error.csv") :
Expected sep (',') but new line or EOF ends field 14 on line 33 when reading data: 6,3,6,,3,2,7,W,J,5,2,6,"X #, ,D,B,A,P,,,,,2,,.
0,8,,,,,,F,Z,6,2,1,,,,,,,,,,5,,.
8,2,,,,,,I,M,0,1,2,,,,,,,,,,5,,.
8,2,,,,,,A,W,6,8,3,,,,,,,,,,8,,#,I,N,L,C,D,K,L,Q,R,J,L,V,E,F,O,N,E,B,Q,Z,S,Y,J
8,3,3,8,2,1,3,Y,S,2,5,4,H,,K,,L,,,,,4,,.
8,7,7,,6,7,0,L,B,1,0,8,K,Q,A,L,Q,,,,,7,,.
8,8,3,7,4,2,5,M,N,3,1,6,I,K,S,L,Q,,,,,5,,.
7,7,0,,6,1,4,V,K,7,6,2,W,S,S,J,P,,,,,1,Y,.
2,3,6,5,8,7,1,Q,H,8,1,4,F,X,V,O,M,,,,,8,A,.
6,8,5,8,4,6,7,S,J,8,7,4,R,B,Y,X,I,,,,,3,Y,.
2,2,0,8,6,4,2,Q,O,6,8,2,I,N,S,M,C,,,,,3,Z,.
6,8,1,3,4,0,1,P,V,6,7,4,J,F,Q,L,E,,,,,1,K,.
6,3,7,0,3,4,7,E,B,5,4,3,D,V,N,L,O,,,,,8,"P",.
It looks like
freaddoes not like long lines when printing error messages.When the line gets long,
freadjust crashes.The sample data can be found in this gist: https://gist.github.com/vlsi/3b9e9e986bf952360397
The input CSV is not well formed, however I expect
freadwould pin-point the wrong pieces.From the
comma_sequence_per_line.csvit looks like I have non-teriminated quoted field at line 9.Ultimately I would like
freadto report exactly that: "possible missing quote for the field started at line 9".Here's the proper (at least it does not crash R) error message (I've shortened all the words and it made
freadto work):Here's abort case:
Here's
lldbbacktrace. I am sorry I have no idea how to enable debug support to make local variables visible tolldb.