On 5/22/07, Jonny Allred <[EMAIL PROTECTED]> wrote:
> I'm trying to convert a massive amount of .doc files to .txt.  I found a
> few applications that can do that from the command line, like catdoc,
> which work great.  Now, I just need to know how to make it convert every
> .doc file I have in a folder (there are about 3000 of them) to a .txt
> file with the same file name.  Is there a way to do that from the
> command line?  If there's not, would a particular programming language work?

I'm not sure how catdoc works (as in if you would want more options
than below), but this is what I would do.

from the root folder where you want to convert all of your .doc files do:
$ find . -name "*\.doc" | while read f;
>do
>catdoc "$f" -f "$f".txt
>done

this will leave you 3000 files named xxxx.doc.txt.  If you wanted, you
then sed the resulting filename to replace ".doc.txt" with ".txt"

Anyway, that's a start.

-- 
Alex Esplin
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to