Counting rows with fread without reading the whole file [duplicate]
问题 This question already has answers here : Is it possible to get the number of rows in a CSV file without opening it? (4 answers) Closed last year . 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