Page 1 of 1
[Solved] File corrupt and therefore cannot be repaired
Posted: Tue Oct 30, 2012 7:51 am
by nattle
Hey friends, something bad here. What, I tell you. I have been using OpenOffice program when I came into my new office. Here nobody uses MS Office. I made some spreadsheets in OpenOffice Calc for our company's annual financial report. The files were good before yesterday, but they are not opening anymore. Here it is what I get while opening them: "The file
myfilename.ods is corrupt and therfore cannot be repaired." We need those spreadsheets. Is there any way to fix this corruption? Like MS Office does OpenOffice have any inbuilt repair function? Please help me.

Re: File corrupt and therfore cannot be repaired
Posted: Tue Oct 30, 2012 2:47 pm
by Hagar Delest
If the recovery has not started automatically, then no repair to be expected. It may be a problem during save operation.
Do you save in native ODF (.ods) or do you use any external format like .xls?
Re: File corrupt and therfore cannot be repaired
Posted: Tue Oct 30, 2012 8:33 pm
by Cybercossack
I was saving in external format (I've now changed my default to odf to avoid it)
Re: File corrupt and therfore cannot be repaired
Posted: Wed Nov 14, 2012 2:00 pm
by MarkAlto800
Corruption issues of Open office Calc files can be easily eliminated with Kernel for Calc recovery. This software repairs corrupt ODS files of Open Office in flawless manner. Recovered objects are placed in a blank Open Office Spreadsheet.
Re: File corrupt and therfore cannot be repaired
Posted: Wed Nov 14, 2012 10:57 pm
by floris v
MarkAlto800 wrote:Corruption issues of Open office Calc files can be easily eliminated with Kernel for Calc recovery. This software repairs corrupt ODS files of Open Office in flawless manner. Recovered objects are placed in a blank Open Office Spreadsheet.
I tried the version for odt and applied it to a corrupt file submitted on this forum. The "repaired" file crashes Windows Explorer if I mouse over it or select it with the cursor keys. I had to write a program in Lazarus to delete the file.
Re: File corrupt and therfore cannot be repaired
Posted: Thu Nov 15, 2012 9:05 am
by MarkAlto800
From where you have downloaded the program?
Re: File corrupt and therfore cannot be repaired
Posted: Thu Nov 15, 2012 2:40 pm
by floris v
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 12:29 am
by kingfisher
IIRC, there is a method for extracting data from a corrupt file. It involves opening the file with a file archiver and copying the content.xml file within it; you may have to change the file extension to zip first although I don't see why.
I don't remember what you do next.
Am I right or am I dreaming?
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 12:34 am
by floris v
The sample that I listed in my previous post can't be opened with 7-zip and winzip, and a free zip repair tool reduced it to a blank file, but acknak managed to recover some of the data all the same - be apparently has some better tool for that than a mere archiver.
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 12:42 am
by RoryOF
kingfisher wrote:IIRC, there is a method for extracting data from a corrupt file. It involves opening the file with a file archiver and copying the .xml file within it; you may have to change the file extension to zip first although I don't see why.
I don't remember what you do next.
Am I right or am I dreaming?
@kingfisher: it depends on whether the archiver recognises the zip file when it is labelled .odt. Some Windows applications did, but Ubuntu Archive Manager did not, requiring it to be relabelled as .zip. In the case of a text file (.odt) the text is in Content.xml; I'm not certain about other OpenOffice file types.
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 12:53 am
by kingfisher
Thanks. I see some information in this post and those which follow:
http://forum.openoffice.org/en/forum/vi ... 60#p213749
It may be timely to state again that files should be backed up regularly.
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 10:38 am
by Hagar Delest
RoryOF wrote:it depends on whether the archiver recognises the zip file when it is labelled .odt. Some Windows applications did, but Ubuntu Archive Manager did not, requiring it to be relabelled as .zip. In the case of a text file (.odt)
I was really pissed off by this problem under Ubuntu and I discovered recently that installing the 7zip application through the software center (even if File Roller support 7z by default IIRC) gives again the possibility to open directly by right click an ODF file and all other compressed assimilated formats.
But still, less powerful than acknak's tool...
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 2:59 pm
by acknak
There's no magic tool that I'm aware of.
What I did:
1) load the damaged zip archive in emacs (a text editor) as raw data
2) locate the content.xml section of the archive data
3) pipe the raw data to the "funzip" program, which outputs the unpacked content.xml
Funzip comes with the "unzip" tools and simply unpacks/uncompresses a single zip archive file.
Emacs doesn't do anything special here; it just makes it easier.
I'm not sure this is the only way to do this. Unzip includes some "fix" options that might work. I've used them in some cases but I didn't try it here. Looking at the zip file data, I could see that the (partial) content.xml file was the only useful piece, so I just cut it out an unpacked it.
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 8:36 pm
by Hagar Delest
Excellent, thanks!
I managed to get exactly the same result on the Nieuw verhaal 2_recovered.odt file in the thread mentioned above!
So the trick is to open the file with Emacs, just delete the content at the beginning until the content.xml start, then use funzip to extract the first file (no need to care about the rest of the archive) and repair the output file.
Re: File corrupt and therfore cannot be repaired
Posted: Fri Nov 16, 2012 10:22 pm
by acknak
Exactly right.
The problem has been solved.
Posted: Wed Nov 21, 2012 1:05 pm
by nattle
After trying/taking every possible steps to no avail, I checked demo versions of some third-party recovery tools. I found OpenOffice Calc recovery of SysInfoTools is best for me. It showed me the preview of recovered data in demo version, where other tools were unable. I found it little economical from others, so I bought its full version. It successfully recovered my files. Thanks to SysInfoTools.
I'm done here.
Thanks for your support guys.

Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Sun Jan 06, 2013 4:58 am
by socrtwo
Here are some free resources for dealing with Open and Libre Office corruption:
- http://sourceforge.net/projects/oorecovery/ - will recover text/data or even text/data with formatting. The method used for recovering formatting is to greatly simplify the styles.xml file then attempt to reopen the the file.
- https://online.officerecovery.com/calc/ - Do a demo recovery using Recoveronix' Online File Repair Service for Calc then scroll down and put in the coupon "S2SERVICES" and get a free full recovery until May 1, 2013. The service usually costs $39 a recovery. The coupon will work with any file type the service supports such as Open Office Writer, Excel, or Quicken files too.
By the way I am the author of the first item mentioned, Open Office Salvager. I believe I included in the data/text extraction algorithm a zip repair step using InfoZip zip.exe. However I'm unsure whether I did it also for the format recovering algorithm recovery choice.
Also note after zip repair, I find 7zip to be the best at unzipping repaired zip files. Additionally take a look at xmllint's recover command. It will add the correct ending tags to say the content.xml file if it is truncated. Zip corruption will often cause truncation of content.xml or styles.xml files giving you error messages on opening attempts.
Sometimes the problem is not content.xml or styles.xml file truncation but rather xml corruption. Try looking at those files in a syntax highlighting code editor such as Notepad++. It may show you at a glance where truncation or XML errors begin. Sometimes it is easier just to truncate the XML after it starts going bad and then put in the correct ending tags with xmllint recover. XML corruption can be extremely difficult for an amateur (for instance me!) to fix.
I explain how to use Infozip's zip.exe, 7zip.exe and xmllint.exe to repair the content.xml file in Microsoft Word DOCX files here,
http://free-data-recovery.blogspot.com/ ... ffice.html. The steps work fine with Open Office files too except the content.xml file is not in the "word/" subfolder but in the root of the Open or Libre Office zip structure.
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Fri Aug 24, 2018 9:03 am
by depaj
Hello,
I see this post has been inactive for a while but I'm looking for some help here :
Recently By mistake I deleted a whole section from a odt. document and right after openoffice auto saved it. I checked but there are no backups (I activated them now in case it ever happens again).
With magic partition recovery (and shadow explorer) I managed to recover to older versions of the file before my mistake but the problem is they are corrupted and openoffice asks me for the ASCII filter and than open a lot of ## and a lot of other gibberish.
-I tried changing the extension to .zip and open it with 7zip, winrar and zipgenius but none worked.
-I then tried to open it with emacs as you suggested and I get a huge amount of this :
I don't find the section you're calling content.xml anywhere...
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Fri Aug 24, 2018 10:20 am
by robleyd
The file is corrupted beyond salvage: see
[Tutorial] How to find and un-delete Writer temporary files and
[Tutorial] The Dreaded Pound Signs: file reduced to ####
In summary, as soon as possible do the following:
Download Recuva (Windows only) or PhotoRec for Win, MacOS, Linux and other OSes (only one needed) and let it do an in-depth recovery of deleted files on your computer. You may get a file containing some or all of your data (or not). Do this as a first priority; other use of the computer may overwrite any existing but deleted files and prevent their recovery. There is no guarantee that you will recover anything useful.
I'd also suggest you install and use the
Time stamped backup which will give you multiple backups.
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Fri Aug 24, 2018 10:22 am
by RoryOF
I suggest taking the last saved version of the file and simply rewriting the deleted section.
Robleyd's advice on timestamped backup extension is good.
Re: File corrupt and therfore cannot be repaired
Posted: Thu Aug 29, 2019 8:29 am
by HugoAntunes
acknak wrote:Exactly right.
dear acknak i have a urgent issue with a damaged file can you send me your email in order to sent you my corrupt file i need your help
thanks
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Thu Aug 29, 2019 9:12 am
by robleyd
If you upload the damaged file, someone may be able to look at it for you.
[Forum] How to attach a document here Note maximum file size is 128K. If your file is larger, use a file sharing site such as Mediafire and post the link here. The link also contains information on how to anonymise your document if it contains confidential information.
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Fri Aug 30, 2019 8:27 am
by HugoAntunes
Dear All please check the file in the attachment and I would appreciate your help to save the data inside
thanks
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Fri Aug 30, 2019 12:32 pm
by robleyd
I'm sorry but your file contains no data at all. If you have a backup, use it; if not, as soon as possible do the following:
Download Recuva (Windows only) or PhotoRec for Win, MacOS, Linux and other OSes (only one needed) and let it do an in-depth recovery of deleted files on your computer. You may get a file containing some or all of your data (or not). Do this as a first priority; other use of the computer may overwrite any existing but deleted files and prevent their recovery. There is no guarantee that you will recover anything useful.
See
[Tutorial] How to find and un-delete AOO temporary files for more information.
Re: [Solved] File corrupt and therefore cannot be repaired
Posted: Fri Aug 30, 2019 6:47 pm
by RoryOF
I confirm - nothing usable in it. Follow robleyd's instructions for any hope of recovering a usable file.