Recovering odt file

Sometime the crazy person don’t care about the interoperability of the document and uses their own formats. This time is painful when you lost the document which is very important and you don’t have enough time to reproduce.

If you got following error then I have got some solution.

Format error discovered in the file in sub-document content.xml at 2,3647(row,col).

To solve the issue, you should extract the file using unzip command then remove the unnecessary contents from content.xml file.
As error reports there is format error in content.xml file, you have to remove those contents of the tag started from 2,3647(row,col) and zip to produce the recovered files. Open the recovered file using office writer, if still it has error then writer automatically solves.

Yeah, your file is recovered. :)

You can follow following steps if you are not familiar with the commands

First, let’s call our nonopening ODT file as “bad.odt”.

  • make backup FIRST -> “$ cp bad.odt bad_original.odt”
  • make new directory-> “$ mkdir repair”
  • copy bad.odt to repair directorty “$ cp bad.odt repair”
  • change default directory to repair -> “$ cd repair”
  • unzip bad.odt -> “$ unzip bad.odt”
  • after unzipping you get bunch of files and directory’s under repair , find content.xml and open it whith your favorite text editor -> “$ gedit content.xml”
  • use “find” function to find out, if you have XML tag “” (somewhere at the beginning of document) and XML tag “” (somewhere, middle of document). If you have, then delete them and all data between them. Be sure, that you don’t delete more or less!
  • save content.xml (keep original name and place!)
  • zip extracted data back to one ODT document -> “$ zip -r ./bad_repaired.odt ./*”
  • try to open repaired document -> “$ ooffice ./bad_repaired.odt”

Cheers !


Leave a Reply

Your email address will not be published. Required fields are marked *