Skip to content

Manipulate ODT file

limelime edited this page Sep 16, 2015 · 9 revisions

Extract ODT file content

ODT file is simply a zip file. To extract, do the following:

cp YOUR_FILE.odt YOUR_FILE.zip
unzip YOUR_FILE.zip

YOUR_FILE.zip extracted will look like the following:

.
├── content.xml
├── META-INF
│   └── manifest.xml
├── meta.xml
├── mimetype
├── settings.xml
└── styles.xml

Reconstruct ODT file

Assuming the content of your ODT file is located in YOUR_FILE directory. To reconstruct the ODT file, do the following:

cd YOUR_FILE/
zip -0 -X ../YOUR_NEW_FILE.odt mimetype
zip -r    ../YOUR_NEW_FILE.odt *

YOUR_NEW_FILE.odt is created.

Links

Open Document Specification v1.2