I'm trying to read a 7.7GB file using fread
, but I get an error that suggests that it stopped reading after only getting partway through the file:
cdr <- fread('/path/to/data.csv')
Read 1687 rows and 610989 (of 610989) columns from 4.000 GB file in 00:02:37
Warning message:
In fread("/path/to/data.csv") :
Stopped reading at empty line 1688 but text exists afterwards (discarded)
cdr <- fread('/path/to/data.csv', nrows = 2000)
Read 0.0% of 2000 rows
Error in fread("/path/to/data.csv", nrows = 2000) :
Expected sep (',') but new line or EOF ends field 500054 on line 1688 when reading data
Note that the error message says the files is 4.000 GB in size, but it's actually 7.7 GB. Similarly, the error message indicates that the file has 1687 rows, but there are actually 3378 rows.
I double-checked, and I can confirm that there is no empty line in this file (thanks @MrFlick for the suggestion).
R is running on a 64-bit Ubuntu instance, and per https://stackoverflow.com/a/18091755/ I checked .Machine$sizeof.pointer
and got 8
(I believe that indicates I'm running R in 64 bits).