[Solved] File corrupt and therefore cannot be repaired

Discuss the spreadsheet application
Post Reply
User avatar
nattle
Banned
Posts: 4
Joined: Tue Oct 30, 2012 7:31 am

[Solved] File corrupt and therefore cannot be repaired

Post 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. :(
Last edited by Hagar Delest on Wed Nov 21, 2012 1:21 pm, edited 1 time in total.
OpenOffice 3.0.1 on Windows 7
User avatar
Hagar Delest
Moderator
Posts: 33535
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: File corrupt and therfore cannot be repaired

Post 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?
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 24.8 portable on Windows 11.
Cybercossack
Posts: 4
Joined: Sat Aug 04, 2012 2:59 am

Re: File corrupt and therfore cannot be repaired

Post by Cybercossack »

I was saving in external format (I've now changed my default to odf to avoid it)
Open Office 3.0.0, Windows Vista
MarkAlto800
Posts: 2
Joined: Wed Nov 14, 2012 1:58 pm

Re: File corrupt and therfore cannot be repaired

Post 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.
Openoffice 3.1 on Win Xp
User avatar
floris v
Volunteer
Posts: 4602
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: File corrupt and therfore cannot be repaired

Post 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.
LibreOffice 24.2.7.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
MarkAlto800
Posts: 2
Joined: Wed Nov 14, 2012 1:58 pm

Re: File corrupt and therfore cannot be repaired

Post by MarkAlto800 »

From where you have downloaded the program?
Openoffice 3.1 on Win Xp
User avatar
floris v
Volunteer
Posts: 4602
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: File corrupt and therfore cannot be repaired

Post by floris v »

IIRC from http://www.nucleustechnologies.com/open ... epair.html
The version from Softpedia is just as bad. Find the test file at http://forum.openoffice.org/en/forum/vi ... 02#p252993
LibreOffice 24.2.7.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
kingfisher
Volunteer
Posts: 2127
Joined: Tue Nov 20, 2007 10:53 am

Re: File corrupt and therfore cannot be repaired

Post 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?
Last edited by kingfisher on Fri Nov 16, 2012 12:44 am, edited 1 time in total.
Apache OpenOffice 4.1.12 on Linux
User avatar
floris v
Volunteer
Posts: 4602
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: File corrupt and therfore cannot be repaired

Post 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.
LibreOffice 24.2.7.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
RoryOF
Moderator
Posts: 35141
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: File corrupt and therfore cannot be repaired

Post 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.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.3 LTS
User avatar
kingfisher
Volunteer
Posts: 2127
Joined: Tue Nov 20, 2007 10:53 am

Re: File corrupt and therfore cannot be repaired

Post 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.
Apache OpenOffice 4.1.12 on Linux
User avatar
Hagar Delest
Moderator
Posts: 33535
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: File corrupt and therfore cannot be repaired

Post 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...
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 24.8 portable on Windows 11.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: File corrupt and therfore cannot be repaired

Post 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.
AOO4/LO5 • Linux • Fedora 23
User avatar
Hagar Delest
Moderator
Posts: 33535
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: File corrupt and therfore cannot be repaired

Post 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.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 24.8 portable on Windows 11.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: File corrupt and therfore cannot be repaired

Post by acknak »

Exactly right.
AOO4/LO5 • Linux • Fedora 23
User avatar
nattle
Banned
Posts: 4
Joined: Tue Oct 30, 2012 7:31 am

The problem has been solved.

Post 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. :D
OpenOffice 3.0.1 on Windows 7
socrtwo
Posts: 2
Joined: Sun Aug 08, 2010 2:49 am

Re: [Solved] File corrupt and therefore cannot be repaired

Post 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.
OpenOffice 3.2 on Windows 7
depaj
Posts: 1
Joined: Fri Aug 24, 2018 8:46 am

Re: [Solved] File corrupt and therefore cannot be repaired

Post 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 :
Sans titre.gif
I don't find the section you're calling content.xml anywhere...
Apache OpenOffice 4.1.3
Windows 10
User avatar
robleyd
Moderator
Posts: 5469
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] File corrupt and therefore cannot be repaired

Post 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.
Slackware 15 64 bit
Apache OpenOffice 4.1.16
LibreOffice 25.8.3.2; SlackBuild for 25.8.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
User avatar
RoryOF
Moderator
Posts: 35141
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] File corrupt and therefore cannot be repaired

Post 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.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.3 LTS
HugoAntunes
Posts: 2
Joined: Thu Aug 29, 2019 8:18 am

Re: File corrupt and therfore cannot be repaired

Post 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
OpenOffice 3.1 on Windows Vista
User avatar
robleyd
Moderator
Posts: 5469
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] File corrupt and therefore cannot be repaired

Post 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.
Slackware 15 64 bit
Apache OpenOffice 4.1.16
LibreOffice 25.8.3.2; SlackBuild for 25.8.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
HugoAntunes
Posts: 2
Joined: Thu Aug 29, 2019 8:18 am

Re: [Solved] File corrupt and therefore cannot be repaired

Post by HugoAntunes »

Dear All please check the file in the attachment and I would appreciate your help to save the data inside
thanks
Attachments
Conta Corrente Despesas Polisgabarito (1).ods
(101.12 KiB) Downloaded 545 times
OpenOffice 3.1 on Windows Vista
User avatar
robleyd
Moderator
Posts: 5469
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] File corrupt and therefore cannot be repaired

Post 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.
Slackware 15 64 bit
Apache OpenOffice 4.1.16
LibreOffice 25.8.3.2; SlackBuild for 25.8.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
User avatar
RoryOF
Moderator
Posts: 35141
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] File corrupt and therefore cannot be repaired

Post by RoryOF »

I confirm - nothing usable in it. Follow robleyd's instructions for any hope of recovering a usable file.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.3 LTS
Post Reply