Open marberts opened 1 year ago
Saving a csv prepared with R or pandas adds an extra row at the bottom. That is, a csv like
a,b 1,3 2,4
becomes
a,b 1,3 2,4 , <-- added
Make a csv with R (or pandas).
Rscript -e "write.csv(data.frame(a = 1:2, b = 3:4), row.names = FALSE, eol = '\r\n')" > test.csv
Then open test.csv in JupyterLab, modify the content of a cell, and save.
test.csv
Removing the line ending on the last line before opening in JupyterLab seems to fix it, but having a CRLF at the end of the last row is allowed by RFC 4180. That is,
cat -e test.csv a,b^M$ 1,3^M$ 2,4^M$
results in an extra line, whereas
cat -e test.csv a,b^M$ 1,3^M$ 2,4
works as expected.
I expect no extra row added when saving a csv.
Description
Saving a csv prepared with R or pandas adds an extra row at the bottom. That is, a csv like
becomes
Reproduce
Make a csv with R (or pandas).
Then open
test.csv
in JupyterLab, modify the content of a cell, and save.Removing the line ending on the last line before opening in JupyterLab seems to fix it, but having a CRLF at the end of the last row is allowed by RFC 4180. That is,
results in an extra line, whereas
works as expected.
Expected behavior
I expect no extra row added when saving a csv.
Context