I have about 75 doc files. If I bring one up in ooffice, I can save it as a .html file with no problem. Is there a way to do it from the command line? All this clickety is going to take me too long.
Thanks
Steven W. Orr wrote:
I have about 75 doc files. If I bring one up in ooffice, I can save it as a .html file with no problem. Is there a way to do it from the command line? All this clickety is going to take me too long.
sudo yum install wv for filename in `ls *.doc`; do htmlname=`echo $filename | sed -e 's/.doc/.html/g'` /usr/bin/wvHtml $filename $htmlname done;
Depending on what your Word files are, your conversion mileage may differ.
-- Sam
On Mon, Feb 09, 2009 at 12:33:58PM +0000, Sharpe, Sam J wrote:
Steven W. Orr wrote:
I have about 75 doc files. If I bring one up in ooffice, I can save it as a .html file with no problem. Is there a way to do it from the command line? All this clickety is going to take me too long.
sudo yum install wv for filename in `ls *.doc`; do htmlname=`echo $filename | sed -e 's/.doc/.html/g'` /usr/bin/wvHtml $filename $htmlname done;
Depending on what your Word files are, your conversion mileage may differ.
Or, since OpenOffice.org is giving you the results you like, rather than switching rendering, you could do the following:
1. Make sure that the PyUNO bits for OpenOffice.org are installed. On Fedora 10, this is the "openoffice.org-pyuno" package (go figure).
2. Download this helpful script, which I found by googling: http://www.artofsolving.com/files/DocumentConverter.py
3. Do a batch conversion:
for F in *.doc ; do H="$(basename "$F" .doc).html" python DocumentConverter.py "$F" "$H" done
Note my little batch command is very similar to the one above; I just happen to be using the "basename" command, which I think most distros include.
On Mon, Feb 09, 2009 at 09:56:07AM -0500, Paul W. Frields wrote:
On Mon, Feb 09, 2009 at 12:33:58PM +0000, Sharpe, Sam J wrote:
Steven W. Orr wrote:
I have about 75 doc files. If I bring one up in ooffice, I can save it as a .html file with no problem. Is there a way to do it from the command line? All this clickety is going to take me too long.
sudo yum install wv for filename in `ls *.doc`; do htmlname=`echo $filename | sed -e 's/.doc/.html/g'` /usr/bin/wvHtml $filename $htmlname done;
Depending on what your Word files are, your conversion mileage may differ.
Or, since OpenOffice.org is giving you the results you like, rather than switching rendering, you could do the following:
- Make sure that the PyUNO bits for OpenOffice.org are installed. On
Fedora 10, this is the "openoffice.org-pyuno" package (go figure).
Download this helpful script, which I found by googling: http://www.artofsolving.com/files/DocumentConverter.py
Do a batch conversion:
for F in *.doc ; do H="$(basename "$F" .doc).html" python DocumentConverter.py "$F" "$H" done
Note my little batch command is very similar to the one above; I just happen to be using the "basename" command, which I think most distros include.
Sorry to reply to myself, but I left out step 2.5:
2.5. Start an OpenOffice service so the script works: :-)
ooffice -accept="socket,port=8100;urp;"