ODF 1.x vs 1.2

Hi all,

Ok, I was wondering about this.

How do I tell what version of the ODF standard any of my individual files are?

I tried opening a spreadsheet (.ods) and checked File > Properties, but nothing in there about the PDF version...

Follow-up question would be, how do I convert the old to the new?

Hi all,

Ok, I was wondering about this.

How do I tell what version of the ODF standard any of my individual files
are?

I tried opening a spreadsheet (.ods) and checked File > Properties, but
nothing in there about the PDF version...

​Open it with a ZIP program​. The file content.xml should start with a
"office:document-content" tag, and somewhere in there is the attribute
"office:version". I believe it contains the file version.
As far as "user friendly" goes, I'm not sure if there is a way to see this
in LibreOffice, because...

Follow-up question would be, how do I convert the old to the new?

​...opening and saving the file should "update" it to the current version.
It is certainly possible to do that through a script if you have a lot of
file.​

Hi :slight_smile:
Presumably it can be done straight from a command-line without even
needing a "script" as such. "Headless mode" sounds great even if it's
not quite as bizarre as it sounds
Regards from
Tom :slight_smile:

TomD wrote

Presumably it can be done straight from a command-line without even
needing a "script" as such.

This is an ideal task for a script. Invoking LO to determine ODF version
info is inefficient, especially for multiple files. Here is a basic bash
script to do the task under GNU/Linux:

#!/bin/bash
# extract <office:version> attribute i.e., ODF version
# args: $1 path to search e.g., doc/
# $2 file extension e.g., sxw odt od*
for f in $1*.$2;
    do
        v=$(unzip -p $f content.xml | xmllint --format - | grep -o
"office:version=[^\>]*" | sed -e 's/office:version=//' -e 's/"//g');
        echo "$f: $v";
    done;