commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
OpenOffice, LibreOffice and OO Impress wordcount
OpenDocument documents from OpenOffice.org,LibreOffice
and other applications, are actually ZIP archives.
Useful informations in these archives are in XML format.
Here we like it or do not. Anyway, the XML files have the unfortunate tendency to
not be indented, and for good reason: they consist of only one line!
To solve the problem and to use a proper editor on the content,
I proceed as follows.
You can also use :
zip document.odt content.xml
And it works with vi instead of nano !
This function does a batch edition of all OOO3 Writer files in current directory. It uses sed to search a FOO pattern into body text of each file, then replace it to foo pattern (only the first match) . I did it because I've some hundreds of OOO3 Writer files where I did need to edit one word in each ones and open up each file in OOO3 gui wasn't an option. Usage: bsro3 FOO foo
Requieres unoconv (debian package)