Open baloe opened 2 years ago
I just had the same issue. Here is an example just using odfpy
#!/usr/bin/env python3
import sys
from odf.opendocument import load
from odf.table import Table, TableRow, TableCell
infile = sys.argv[1]
doc = load(infile)
cell= doc.getElementsByType(Table)[0].getElementsByType(TableRow)[2].getElementsByType(TableCell)[0]
print(cell)
Using the same spreadsheet as above you get the output:
cell with A line break
Yes, same issue here. Is there a fix?
Index Col\nNext Line
is getting read as Index ColNext Line
Checked in version: 1.4.1
Please see #123 about the project status. The project is nearly orphaned.
Sorry to see that this project has gone stale.
Will explore jdum/odfdo as referenced in #123
Thanks 👍🏻
Thanks for the report, the issue was driving me crazy. Sadly, odfdo
doesn't seem to be a drop-in replacement for odfpy
. I'll stick to using openpyxl
for now. Thank you everyone who contributed to the thread!
Linebreaks within a text cell are not read.
Here's a small example: I saved this sheet as doc.ods and doc.xlsx.
The following script
prints
lacking the newline character
\n
in the pandas dataframe produced through odf.Versions: