Last line of csv file is not read by fread from package data.table with error message 'Discarded single-line footer'

Viewed 3340

I have a csv file that has windows line endings (CR LF) and is separated by semicolon. The last line in the file is an empty line, i.e. no semicolons contained or any other character.

When reading the file with fread from the data.table package the second last line, i.e. the last data row, is not loaded and the error message says "Discarded single-line footer".

1 Answers

Try inserting fill = TRUE.

In my case, inserting fill = true all works correctly.

Related