Fix a text document (odt) with charts saved as odc

Somehow a text document that was already saved as odt was suddenly saved as odc after adding some charts inside, the person that was editing the file didn’t notice the change and continue editing the file, adding more text and keep saving it as odc, now we end up with an old odt file, without the last changes, and an odc file that don’t open. There is some way of fixing this?

[edit: remove redundant tag]

Possibly the command-line options may be your saviour, at least to rescue the most recent text changes.

(examples that follow are from my own system under Debian; YMMV)

To see all the options:

:~$ /opt/libreoffice4.4/program/soffice.bin --help
LibreOffice 4.4.4.3 2c39ebcf046445232b798108aa8a7e7d89552ea8

Usage: soffice [options] [documents...]
...

Options that may assist here:

    :~$ /opt/libreoffice4.4/program/soffice.bin --help
    ...
    --convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files
          Batch convert files.
          If --outdir is not specified then current working dir is used as output_dir.
          Eg. --convert-to pdf *.doc
              --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc
              --convert-to "html:XHTML Writer File:UTF8" *.doc
              --convert-to "txt:Text (encoded):UTF8" *.doc
    --cat files
          Dump text content of the files to console
          Eg. --cat *.odt

An example to save text into a file ‘rescue.txt’ in the current dir
(tested with text/html, text/css + ODT file - each of these files are opened in the GUI first):

:~$ /opt/libreoffice4.4/program/soffice.bin --cat filename.odc > ./rescue.txt

AFAIK the filetype is indicative rather than nominative (I’ve been reading too many w3c documents). In other words, being called ‘odt’ indicates that is a Writer file rather than forcing the contents into the writer format. However, I’ve not perused the source-code so cannot be certain.

The final, last-gasp answer is to open the file using 7-Zip/ZIP (7-zip does not care what it’s called, but ZIP will probably need you to rename the ODC file to ZIP) & extracting the text file from the collection.

If this helps then please tick the answer (:heavy_check_mark:).

No, ‘–cat’ produce nothing.

I think this should be marked as a bug, could be easily reproduced,

  • just start a text doc
  • save it as odt
  • add a diagram
  • libreoffice leaves the focus on the diagram
  • save the document, and a dialog appears with the new extension (odc) selected, looks like libreoffice is trying to save the diagram not the full document

If you didn’t notice that change, if you are a novice user that don’t fully understand the difference between those extension, you could think than that is ok and you will keep editing and saving, now you are doomed, all those changes after that are lost because libreoffice can’t open the odc file…

Hi

Some things are not clear for me:

- If the document was saved in Writer format with the extension .odc it can not be opened by double-clicking from the file explorer but it may be by File Open in LibreOffice.

  • If the document was saved in odc format, it should only contain a chart. It can be imported in a Calc spreadsheet by Insert Object Chart From File

Another aspect of things, your system (Linux, windows, mac?) can perhaps restore an older version (e.g. see for Windows.

[EDIT]
You answered my question in the meantime on the format. It remains my proposal on the restoration …

Regards

No, importing the odc into a calc spreadsheet shows an empty chart… BTW, apparently the file contains the graphics data, the original odt file was 47K in size, and the odc 451K…
My system is Linux, Fedora Linux… the original editing was made with Fedora 21 and now I’m trying to fix this in Fedora 22, the problem is reproducible in both systems.