Count the words in any OpenOffice document (including Impress presentations)

unzip -p doc.odt content.xml | sed 's|<[^>]*>| |g' | wc -l
OpenOffice, LibreOffice and OO Impress wordcount

These Might Interest You


  • 0
    detex document.tex|wc -w
    jasonjgw · 2010-11-17 09:00:37 0
  • Bases word count on the genreated PDF file; so make sure to update this first. The PDF file also includes references and output of any macros. Show Sample Output


    0
    pdftotext file.pdf - | wc -w
    computermacgyver · 2013-06-01 16:29:04 0
  • 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. Required xmlindent You can also use : zip document.odt content.xml And it works with vi instead of nano !


    0
    unzip document.odt content.xml && xmlindent -w content.xml && nano content.xml
    arthurdent · 2012-12-01 17:05:28 0
  • Style analyses the surface characteristics of the writing style of a document. It prints various readability grades, length of words, sentences and paragraphs. It can further locate sentences with certain characteristics. If no files are given, the document is read from standard input. style is part of "diction" package Show Sample Output


    2
    style TEXT-FILE
    alperyilmaz · 2010-10-27 08:07:04 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: