I'd like to rip the titles from a bunch of word documents. All the CLI tools I've tried for converting .doc to text lose the title... but Abiword's conversion to RTF preserves it, eg:

$ abiword --to=rtf something.doc

gives something.rtf, a text-encoded file that includes the title.

So far so good but I need one line of the file, writing it seems very wasteful. (eg if I could get the output to go to stdout, I'd run this with Python's subprocess, capture it and apply a regex to get a list of titles).

But, unless I'm missing something, Abiword CLI tool doesn't seem to be set up to output to standard out. You can either:

  • specify output format, giving original file name + new extension, or
  • specify filename; Abiword infers file type from the extension.

Is there a way to get around this, and just get the output via stdout?


There's an example in the abiword man page:

abiword --to=rtf --to-name=fd://1 something.doc
  • 1
    I wonder whether --to-name=/dev/stdout would work.  P.S. It may be possible to use -o instead of --to-name. – G-Man Says 'Reinstate Monica' Apr 14 '15 at 19:19
  • I tried that: AbiWord: Uch! Could not write the file [/dev/stdout] – glenn jackman Apr 14 '15 at 20:25

-o works without the '=', eg:

abiword --to=rtf -o fd://1 something.doc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.