Talk:Ods2wiki.pl

From Organic Design wiki

Repeated columns

A bug was found in the Open Office spreadsheet parser where some rows would have the wrong column count, this was finally isolated to a new attribute called table:number-columns-repeated which allows identical columns to be defined just once as shown in the snippet below. The first table row has a missing column, but is using the new attribute to duplicate it.

<table:table-row table:style-name="ro2">
	<table:table-cell table:style-name="ce2"/>
	<table:table-cell table:style-name="ce4"/>
	<table:table-cell table:style-name="ce6" office:value-type="string">
		<text:p>c</text:p>
	</table:table-cell>
	<table:table-cell table:style-name="ce8" table:number-columns-repeated="2"/>
	<table:table-cell table:style-name="ce9"/>
	<table:table-cell table:style-name="ce11"/>
	<table:table-cell table:style-name="ce12"/>
	<table:table-cell table:style-name="ce15" table:formula="of:=SUM([.I9:.I18])" office:value-type="time" office:time-value="PT38H30M00S">
		<text:p>38:30</text:p>
	</table:table-cell>
	<table:table-cell table:number-columns-repeated="1015"/>
</table:table-row>

<table:table-row table:style-name="ro2">
	<table:table-cell table:style-name="ce2"/>
	<table:table-cell table:style-name="ce4"/>
	<table:table-cell table:style-name="ce6"/>
	<table:table-cell table:style-name="ce8" office:value-type="string">
		<text:p>d</text:p>
	</table:table-cell>
	<table:table-cell table:style-name="ce8"/>
	<table:table-cell table:style-name="ce9"/>
	<table:table-cell table:style-name="ce11"/>
	<table:table-cell table:style-name="ce12"/>
	<table:table-cell table:style-name="ce15" table:formula="of:=SUM([.I10:.I19])" office:value-type="time" office:time-value="PT76H00M00S">
		<text:p>76:00</text:p>
	</table:table-cell>
	<table:table-cell table:number-columns-repeated="1015"/>
</table:table-row>

Testing

I ran the script over some large spreadsheets of around 10,000 rows and it worked well with no errors processing about 1000 rows per second.