Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install catdoc on Mac (without using macports)

background

I really would like to search for a term in a directory full of Word docs. So I stumbled across this lovely solution. However this solution requires that catdoc is installed on mac.

what I have tried

now homebrew obviously doens't have catdoc:

$ brew install catdoc
Updating Homebrew...
Error: No available formula with the name "catdoc"
==> Searching for a previously deleted formula...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.

macports does, but I use homebrew and It's not a good idea to have both on my machine.

So I did what any self respecting semi-programmer would do: try to install it from source:

$ ./configure 

see outpout

$ ./make

see output

the last part of ./make gives me this

1 warning generated.
gcc -o catppt catppt.o pptparse.o charsets.o substmap.o fileutil.o confutil.o numutils.o ole.o  -lm
echo "#! /usr/bin/wish" >wordview
echo set charset_lib "\"/usr/local/share/catdoc\"">>wordview
cat wordview.tcl >>wordview
chmod 0755 wordview
touch build
make[1]: Nothing to be done for `all'.

then when i run make install i get this

make: `install' is up to date.

and obviously catdoc doesn't work:

$ which catdoc
>> nothing

Question

How can I install this?

like image 329
abbood Avatar asked Oct 16 '25 00:10

abbood


2 Answers

You could just use the built-in textutil to convert MS-Word documents to text:

textutil -stdout -cat txt SomeFile.doc 

or

textutil -stdout -cat txt *.doc 
like image 145
Mark Setchell Avatar answered Oct 18 '25 17:10

Mark Setchell


To build catdoc / catppt / xls2csv on Mac OS X (macos)

tested with catdoc-0.95 on Mac OS X 10.9.5

Configuration

First, unless your documents are likely to be written in a Cyrillic language, start with:

$ ./configure --with-input=cp1252 --with-output=mac-roman

(if you are more likely to encounter files from Windows)

... or ...

$ ./configure --with-input=mac-roman --with-output=mac-roman

(if you are more likely to encounter files from MacOS)

Building

$ make all (or just $ make)

Installation

make --directory=src install; make --directory=doc install; make --directory=charsets install

This should compensate for the error you received, abbood. It appears the primary Makefile isn't running the install portion of the three subdirectories, for some reason. If a permissions error is reported, precede the above command with "sudo".

I don't believe this should be necessary, but I'm not familiar enough with makefiles to provide a more proper (textbook) fix.


One can, of course, get the same effect by:

$ cd src
$ make install
$ cd ../doc
$ make install
$ cd ../charsets
$ make install
$ cd ..

Cleanup

To remove all files created by make, type:

  • $ make clean

To remove all files created by make as well as those created by ./configure, type

  • $ make distclean

like image 34
Jim Grisham Avatar answered Oct 18 '25 18:10

Jim Grisham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!