August 31, 2005

Use Abiword to convert filetypes on the command line

Abiword is a wordprocessor which can be used as an alternative to popular commercial counterparts. It comes installed by default on most linux distributions. Did you know that you can convert from one file type to another in the command line using abiword ? This is how it is done. First fire up a terminal and then enter the following command:
$ abiword --to=abw myfile.doc
The above command converts the 'myfile.doc' MSWord document into a new file of abiword format by the same name - 'myfile.abw' .
If you want the file to be of different name, do the following:
$ abiword --to=myotherfile.abw myfile.doc
To convert an doc file to OpenOffice.org format (sxw) :
$ abiword --to=sxw myfile.doc
... You get the drift ?? You can use the above steps to convert to/from any format supported by abiword.
And if you want to convert a directory full of MSWord documents to abiword or some other format, you can use the following simple script:
for i in * ; do abiword --to=sxw $i ; done
This would convert all documents in the current directory into OpenOffice.org format.
Related Content


0 comments:

Get Posts via email