Error in calc file

I have an error in a spreadsheet on opening.

Any help would be very much appreciated.

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

Thanks,

Theo

Theo,

I have an error in a spreadsheet on opening.

Any help would be very much appreciated.

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

Thanks,

Theo

Can you open or create a new spreadsheet in Calc? You might have a corrupted file. However the ods file can be unzipped and you can open the xml file inside to text editor.

Thanks for the answer Jay.

I have tried some suggestions found by Googling.

1. I copied the file to a new folder and renames it from .sxc to .zip.
2. I extracted the files within.
3. The content.xml file is big - over 4mb. I tried opening it with gedit and notepad without success.
4. Opened the file in Windows with notepad and got a mass of text - 4049 lines and 1070 columns.

I guess this means I can edit the text, but what do I edit?

Thanks, Theo

Theo,

I have an error in a spreadsheet on opening.

Any help would be very much appreciated.

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

Thanks,

Theo

Can you open or create a new spreadsheet in Calc? You might have a corrupted file. However the ods file can be unzipped and you can open the xml file inside to text editor.

Thanks for the answer Jay.

I have tried some suggestions found by Googling.

1. I copied the file to a new folder and renames it from .sxc to .zip.
2. I extracted the files within.
3. The content.xml file is big - over 4mb. I tried opening it with gedit and notepad without success.
4. Opened the file in Windows with notepad and got a mass of text - 4049 lines and 1070 columns.

I guess this means I can edit the text, but what do I edit?

You can try saving the text file as either txt or csv which you can import into Calc. You will lose any formulas in the original file

Hi Theo,

Theo schrieb:

Theo,

I have an error in a spreadsheet on opening.

Any help would be very much appreciated.

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

Thanks,

Theo

Can you open or create a new spreadsheet in Calc? You might have a
corrupted file. However the ods file can be unzipped and you can open
the xml file inside to text editor.

Thanks for the answer Jay.

I have tried some suggestions found by Googling.

1. I copied the file to a new folder and renames it from .sxc to .zip.
2. I extracted the files within.
3. The content.xml file is big - over 4mb. I tried opening it with gedit
and notepad without success.
4. Opened the file in Windows with notepad and got a mass of text - 4049
lines and 1070 columns.

You can open the content.xml file in a browser for example Firefox. It shows you the place of the error. After you have repaired one place, open the file again in the browser to show the next error. If the browser shows a tree view, the file is successfully repaired.

I guess this means I can edit the text, but what do I edit?

As far as I remember there had been two kind of errors.
(1) There are duplicate attributes. You will see exactly same text before and after the error mark. Delete one of them.
(2) Instead of one _5f or one _20 you see something like _5f_5f_5f. Reduce them to one.

These errors had been produced be some developer or beta versions long ago. Your error might be different, but you should look whether it is one I had described.

Kind regards
Regina

Hi :slight_smile:
You can usually open xml documents in text-editors such as Notepad, Gedit, Kate or whatever.  Notepad doesn't colour-code it but most other ones do after you have changed the view from plain text to something such as html, css or xml or something like that.  SciTe is quite good in Windows.  Regina's idea of using a web-browser means you can't edit the document (i think) but it's a quick and neat way of getting colour coding without fussing around. 
Regards from
Tom :slight_smile:

Hi Tom,

Tom Davies schrieb:

Hi :slight_smile: You can usually open xml documents in text-editors such as
Notepad, Gedit, Kate or whatever. Notepad doesn't colour-code it but
most other ones do after you have changed the view from plain text to
something such as html, css or xml or something like that. SciTe is
quite good in Windows. Regina's idea of using a web-browser means
you can't edit the document (i think) but it's a quick and neat way
of getting colour coding without fussing around.

You need a tool to mark the error, therefore I suggest the browser; it is not for editing. If it is the kind of error I guess, then there is likely more than one error in the file.

Kind regards
Regina

Could something like the Seamonkey suite be used instead of
FireFox? Control+E will open the browser's contents in an html editor.
Seems like this would allow finding the errors one by one in the browser
and correcting them the html editor. Just a thought.

--Dan

Many thanks for the help. This file contains aspects of our business records for the past 6 years. We had a regular 2 hourly backup scheduled which unhappily has meant our backup data was overwritten with the corrupted file before we knew we had a problem. So we really appreciate the help. Our last uncorrupted backup is from last May!

Opening the file content.xml in Firefox shows a heading thus:

XML Parsing Error: duplicate attribute
Location: file:///home/theo/junk/repair/baddailyturnover/content.xml
Line Number 2, Column 734593:

The line that follows, in red, is more than 15 pages long when copied and pasted to a text document, which itself is 974 pages long.

When previewed in Firefox, the file is converted to html, and in Firefox it can be seen that the affected line seems to be all the entries at the start of the file relating to "style", but I wouldn't know where to look for the error. I tried deleting that line but that didn't work!!

Theo

Many thanks for the help. This file contains aspects of our business records for the past 6 years. We had a regular 2 hourly backup scheduled which unhappily has meant our backup data was overwritten with the corrupted file before we knew we had a problem. So we really appreciate the help. Our last uncorrupted backup is from last May!

Ouch!!!

Opening the file content.xml in Firefox shows a heading thus:

XML Parsing Error: duplicate attribute
Location: file:///home/theo/junk/repair/baddailyturnover/content.xml
Line Number 2, Column 734593:

The line that follows, in red, is more than 15 pages long when copied and pasted to a text document, which itself is 974 pages long.

When previewed in Firefox, the file is converted to html, and in Firefox it can be seen that the affected line seems to be all the entries at the start of the file relating to "style", but I wouldn't know where to look for the error. I tried deleting that line but that didn't work!!

It could be the html code in the line or IMHO a line just prior. My guess is that a tag is not properly closed or the wrong tag format is being used. XML is fussier than html about using the correct tag formats and the like. For example <br> is acceptable html but not acceptable XML, the correct XML is <br />. If the line before the red text has the bad code, deleting the red text will not help.

If you can post a snippet on Nabble someone might sort out the problem.

Hi Theo,

Theo schrieb:

[..]

Opening the file content.xml in Firefox shows a heading thus:

XML Parsing Error: duplicate attribute
Location: file:///home/theo/junk/repair/baddailyturnover/content.xml
Line Number 2, Column 734593:

That sounds like the case (1) I have described.

The line that follows, in red, is more than 15 pages long when copied
and pasted to a text document, which itself is 974 pages long.

When previewed in Firefox, the file is converted to html, and in Firefox
it can be seen that the affected line seems to be all the entries at the
start of the file relating to "style", but I wouldn't know where to look
for the error. I tried deleting that line but that didn't work!!

Can you see the error mark in Firefox? Firefox draws a dashed line and at the end of that line is a little triangle pointing to the error. But your document is really huge and Firefox might be unable to cope it. Perhaps you can estimate where 734593 characters end?

When you reach the place of the error, you should see some text twice. It will be a little bit before and after the error place. Remember that text and search for it in the editor. That are the "duplicate attribute" Firefox named as parsing error. In the editor delete one of them. Save the file and reopen it in Firefox and let Firefox show you the next error. It is very likely, that the error at place character 734593 is not the only error and you will have to loop several times.

[I hope, all repair tries are made on a copy!]

Another idea you can try: Take a document of the same kind, which has no data and unzip it the same way. Then copy that part of the broken content.xml, which contains the data, and replace the corresponding part of the new file with it. That will loose all formatting, but might recover the pure data.

Kind regards
Regina

Hi Jay,

Jay Lozier schrieb:
[..]

It could be the html code in the line or IMHO a line just prior. My
guess is that a tag is not properly closed or the wrong tag format is
being used. XML is fussier than html about using the correct tag formats
and the like. For example <br> is acceptable html but not acceptable
XML, the correct XML is <br />. If the line before the red text has the
bad code, deleting the red text will not help.

A tag error is unlikely. Normally you can trust the parser of Firefox and if it says "duplicate attribute" that is indeed the error and you should search for the duplicate attribute.

Kind regards
Regina

The line in Firefox is just about at the top of the file. The only line before it is:

<?xml version="1.0" encoding="UTF-8"?>

Thanks, Theo

Regina and Jay, you guys are great!!!

Regina, it was a duplicated line of text.

All fixed thank you. Time to re-evaluate our back up strategy.

Again, many thanks,

Theo

Hi :slight_smile:
Ok, this is a long shot and going off on a tangent.

I think most of us are guessing that you have already run through all this many times in your mind.  If you turned on the back-ups feature then back-ups are stored in a sub-folder in the user-profile
http://wiki.documentfoundation.org/Documentation/UserProfile
Also did the file get copied onto a network?  Is it stored on a local machine?  Did it get saved on a local machine and then copied to a network folder?  Did it get emailed?  or saved to usb-stick/cd/dvd to work on at home or show in a meeting?  Did it get saved in a different format such as .xls or .csv recently?

Regards from
Tom :slight_smile:

Hi :slight_smile:
WooHooo, congrats!  A 1st step

Tools - Options - "+Load/Save" - General

Tick the relevant "backup" option.  Wikipedia pages might have good links that are not purely about selling a product.  Here is one
http://en.wikipedia.org/wiki/Backup#Storage.2C_the_base_of_a_backup_system
https://help.ubuntu.com/community/BackupYourSystem

If you are on Gnu&Linux or possibly any other unix-based platform then rsync is a standard command-line tool that is either included by default or else easy and free to install.  Grsync gives it a nice gui front-end for a gnome DE.  It can back-up over a network apparently
https://help.ubuntu.com/community/rsync

Regards from
Tom :slight_smile: