-
-
Notifications
You must be signed in to change notification settings - Fork 13
Description
import pyexcel_ods3
print(pyexcel_ods3.get_data('test.ods', keep_trailing_empty_cells=True))
test.ods contains a simple table
A1,B1
A2,B2
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2']])])
If add color to these 4 cells, the output of print is the same.
I add a color to the 3th row, I get a new "empty" row as output, an that's fine:
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2'], ['', ''], ['', '']])])
I remove the color from the 3th row by clicking to "No fill", I still get
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2'], ['', ''], ['', '']])])
I guess 'No fill' doesn't really remove the color info.
Removing the row by right click, does the job, no more empty row.
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2']])])
Now the more interesting part: click on column "A" (selection goes till the end of the sheet), add a color and print the table:
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2'], ['', ''], ['', '']])])
We get an extra empty row.
Now, if I remove the color form the whole column, I still get the empty row.
I shall remove column A to get rid of it but in such case I loose data.
OrderedDict([('Sheet1', [['B1'], ['B2']])])
Well, the issue is probably the same or very similar to the first case, bu in this case I have no way to work around it.
You get the very same issue if you add borders (or color) to cells C1, C2.
There are no values on these cells and you get
OrderedDict([('Sheet1', [['a1', 'b1', ''], ['a2', 'b2', '']])])
and this is fine.
Removing borders or colors is not going to remove the empty column, you have to right click and delete the column.
If select the whole rows 1 and 2, add color, the remove it, you can't get rid of the "empty" column (right click / delete on column "C" is not going to help).
OrderedDict([('Sheet1', [['a1', 'b1', ''], ['a2', 'b2', '']])])
So I think pyexcel3 shall handle cell where decorations have been totally remove and shall ignore decorations of whole rows or columns.