6

As I mentioned there , how can I view documents( ex: .doc,.docx and all other formats ) from the command line ? Is there any way ?

Thank you.

Raja G
  • 102,391
  • 106
  • 255
  • 328

2 Answers2

11

I have been using the following setup in several scripts (especially with version control):

sudo apt-get install unoconv odt2txt     # installs both tools
doc2odt test.doc                         # creates test.odt
odt2txt test.odt                         # displays the contents in the terminal

or for a docx file:

docx2txt test.docx                       # converts docx file
less test.txt                            # read the contents

Works like a charm and you can read your doc files in the terminal. This method is more complex than catdoc but it has the advantage that entries from a bibliographic management system are not displayed in their raw form.

For a LaTex file you can just your favorite terminal text editor to open and read it.

don.joey
  • 28,662
  • Hey , thanks for looking my post. could you explain this little bit " the advantage that entries from a bibliographic management system are not displayed in their raw form" – Raja G Oct 24 '13 at 08:38
  • For academic writing people might use things like Mendeley, Endnote, JabRef to manage their citation references . With catdoc these appear as [ADDIN: {author: Don Joey} { title: ...} ...]. When you have many of them that is hard to read. This is where odt2txt conversion comes in handy because you will just see Don Joey, Some Supposedly Interesting Book,... rather than the raw info. – don.joey Oct 24 '13 at 08:42
  • Ok Now I understood but I think the support of LaTex is missing here right ? catdoc can do that. – Raja G Oct 24 '13 at 08:43
  • 1
    For LaTex you can just use vim. After all that's the goal of LaTex, to type text as is and convert it to publishable text afterwards. – don.joey Oct 24 '13 at 08:44
  • No I mean to say that , If DOC consists of some symbolic things then Latex support we need to view them best . so is this can provide ? becasue Catdoc can provide that – Raja G Oct 24 '13 at 08:46
  • Symbols you mean? I'd have to check how symbols are transposed in the conversion to a txt file. I think there must be quite some consistency. If you have a document, please try and let us know. The unoconv toolbelt is very advanced. – don.joey Oct 24 '13 at 08:49
  • Yeah I will do that , thanks again for stopping by. – Raja G Oct 24 '13 at 08:52
5

To View word documents from the command line I found one named as catdoc.

to install it sudo apt-get install catdoc

then

catdoc -t filename.doc

You can specify the output format using the -a (text) or -t (LaTeX) option

Raja G
  • 102,391
  • 106
  • 255
  • 328