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

1

7

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

Homily answered 11/1, 2019 at 16:21 Comment(1)
Try setting blank.lines.skip=FALSEBeheld
A
8

Try inserting fill = TRUE.

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

Alhambra answered 27/2, 2019 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.