I want to use data.table to process a very big file. It doesn't fit on memory. I've thought on reading the file on chunks using a loop with (increasing properly the skip parameter).
fread("myfile.csv", skip=loopindex, nrows=chunksize)
processing each of this chunks and appending the resulting output with fwrite.
In order to do it properly I need to know the total number of rows, without reading the whole file.
What's the proper/faster way to do it?
I can ony think in reading only the first column but maybe there is an special command or trick. or maybe there is an automatic way to detect the end of the file.