ODFinfo
ODFinfo is a command-line to extract meta information from Open Document Format files. Supported meta information includes creator, used application, or date of last modification. Ouput is either plain text or CSV (using switch -c).
ODFinfo is similar to pdfinfo (part of poppler), otfinfo (part of LCDF Typetools), and the file tool.
ODFinfo is released under the GNU General Public License version 3 or any later version.
Example 1
Calling odfinfo sonido.odp (a file downloaded somewhere) resulted in this output:
filename : sonido.odp ODF version : 1.2 generator : OpenOffice.org/3.0$Unix OpenOffice.org_project/300m15$Build-9379 operating system : Unix (Mac OS X, BSD, ...) application : OpenOffice mime type (claimed) : application/vnd.oasis.opendocument.presentation mime type interpretation: Presentation page width (mm) : 254.000 page height (mm) : 190.500 page size format : Unknown (landscape) last modified date : 2009-07-09T20:56:39 creator : Martin Carrera title : Los sonidos object count : 92
To get output in CSV format, use the switch -c:
"filename";"sonido.odp" "ODF version";"1.2" "generator";"OpenOffice.org/3.0$Unix OpenOffice.org_project/300m15$Build-9379" "operating system";"Unix (Mac OS X, BSD, ...)" "application";"OpenOffice" "mime type (claimed)";"application/vnd.oasis.opendocument.presentation" "mime type interpretation";"Presentation" "page width (mm)";"254.000" "page height (mm)";"190.500" "page size format";"Unknown (landscape)" "creation date"; "last modified date";"2009-07-09T20:56:39" "print date"; "creator";"Martin Carrera" "language"; "title";"Los sonidos" "subject"; "description"; "page count"; "paragraph count"; "word count"; "character count"; "table count"; "image count"; "object count";"92"
Of course, several file names can be passed to odfinfo in one call. Each file will add one column to the resulting CSV file.
Example 2
Assume you have a large set of OpenDocument files (.odt, .ods, ...) in a directory and you do not recall which one was written by your friend Theo.
Now, you could write a small script which unzips all files and checks for "Theo", but this would match all document containing "Theo" in any position of the document such as the main text body. It may even match words starting with "Theo" like "Theoretically".
With odfinfo, you can simply write something like this:
for f in *.odt *.ods *.odp ; do odfinfo -c $f | \ grep -qi '^"creator";.*\btheo\b' && echo $f ; done
Download
Bugs
ODFinfo is in an early stage of development. If you observe a bug, please send me an email including the OpenDocument file where ODFinfo failed.
Last Updated: 19-Apr-2012 Contact: Thomas Fischer