El archivo .ods es un archivo .zip en realidad, dentro tiene unas carpetas y unos archivos, por ejemplo:
Código:
drwxrwxr-x 11 user group 4096 Jul 1 17:56 Configurations2
-rw-rw-r-- 1 user group 5553 Jul 1 15:50 content.xml
-rw-rw-r-- 1 user group 899 Jul 1 15:50 manifest.rdf
drwxrwxr-x 2 user group 4096 Jul 1 17:56 META-INF
-rw-rw-r-- 1 user group 840 Jul 1 15:50 meta.xml
-rw-rw-r-- 1 user group 46 Jul 1 15:50 mimetype
-rw-rw-r-- 1 user group 9370 Jul 1 15:50 settings.xml
-rw-rw-r-- 1 user group 15352 Jul 1 15:50 styles.xml
drwxrwxr-x 2 user group 4096 Jul 1 17:56 Thumbnails
Luego los datos estan en un archivo XML llamado
content.xml ese es el archivo a cargar y recorrer, y tiene la siguiente estructura:
Código:
<table:table table:name="Sheet1" table:style-name="ta1">
<table:table-column table:style-name="co1" table:default-cell-style-name="Default"/>
<table:table-column table:style-name="co2" table:number-columns-repeated="5" table:default-cell-style-name="Default"/>
<table:table-row table:style-name="ro1" table:number-rows-repeated="4">
<table:table-cell table:number-columns-repeated="6"/>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>x</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>Gambas</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>Python</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>C++</text:p>
</table:table-cell>
<table:table-cell table:number-columns-repeated="2"/>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>z</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="float" office:value="1" calcext:value-type="float">
<text:p>1</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="float" office:value="2" calcext:value-type="float">
<text:p>2</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="float" office:value="3" calcext:value-type="float">
<text:p>3</text:p>
</table:table-cell>
<table:table-cell table:number-columns-repeated="2"/>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>w</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>a</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>b</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1" office:value-type="string" calcext:value-type="string">
<text:p>c</text:p>
</table:table-cell>
<table:table-cell table:number-columns-repeated="2"/>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell table:number-columns-repeated="6"/>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell office:value-type="string" calcext:value-type="string">
<text:p>s</text:p>
</table:table-cell>
<table:table-cell office:value-type="string" calcext:value-type="string">
<text:p>t</text:p>
</table:table-cell>
<table:table-cell office:value-type="string" calcext:value-type="string">
<text:p>u</text:p>
</table:table-cell>
<table:table-cell office:value-type="string" calcext:value-type="string">
<text:p>v</text:p>
</table:table-cell>
<table:table-cell/>
<table:table-cell office:value-type="string" calcext:value-type="string">
<text:p>r</text:p>
</table:table-cell>
</table:table-row>
</table:table>
Asi que finalmente puedes leer y escribir datos con el componente gb.xml, este componente tiene herramientas para gestionar los nodos XML y el texto es una propiedad del nodo. no tengo a mano un codigo que haga esa parte pero puedo buscarlo.