Oliver
Oliver

Reputation: 312

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

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".

Upvotes: 7

Views: 5110

Answers (1)

Sab
Sab

Reputation: 96

Try inserting fill = TRUE.

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

Upvotes: 8

Related Questions