Evanescent Thoughts

Evanescent Thoughts

Easy command line solution to the docx problem in Linux

with 3 comments


Till yesterday , i was ignorant of the following command line tool called Odfconverter for converting docx to odt. And much to the relief it works fine and does the job pretty well so i guess it would be a part of the next open office release. The procedure was simple.The point is tht microsoft had switched from the binary format to the Open XML format with their new word 2007 and they now released the details of doc format.

This works fine in fedora and i guess it should in ubuntu as well..

1. For fedora make sure u have the rpm2cpio using

sudo yum -y install cpio rpm ( for configuring sudo on fedora refer here or use su -c or login as root )

For ubuntu users

sudo apt-get install rpm libgif4

Fedora users can even skip this step and directly proceed to installing the following rpm odf-converter-1.1-7.i586.rpm.

But the general idea is the same no matter which Linux distribution you use. You are basically copying one file out of the RPM as if it were a tarball or a zip file. You are not installing the RPM in the traditional sense, so don’t worry if you run a non-RPM-based system such as Ubuntu, Debian. After downloading the OdfConverter

  • Open a console.
  • Change directory to your download directory. Depending on your setup, it may be: cd ~/Desktop
  • To unpackage the rpm, run this command: rpm2cpio odf-converter*rpm | cpio -ivd
  • To copy the binary run this command: sudo mv usr/lib/ooo-2.0/program/OdfConverter /usr/bin

The usage is simple. To convert a .docx file (Word 2007) to a .odt (OpenDocument Format) file, just run:

OdfConverter /i example.docx

and you will find the odt file in the same folder… Bingo .. u got it done 😛

Any problems or better ways to do please do mention it in comments..

All credits to google .:P

Advertisements

Written by Sathya Narayanan

September 14, 2008 at 9:29 am

Posted in computers, Linux

3 Responses

Subscribe to comments with RSS.

  1. Thanks !
    Did have this problem, did not know odf-converter existed. As a PClinuxOS user first thing I did was look in Synaptic (the PCLOS/mandriva-based APT package manager), search for odf-converter, found & installed it.
    Problem solved !
    Tks again for the tip !

    Oliver

    September 15, 2008 at 5:03 pm

  2. Cognitive text., bro

    rurbquortuh

    September 22, 2008 at 1:44 pm

  3. i could convert docx files using odf converter in command line. but if i try to convert it using php like exec(“OdfConverter /i example.docx”);
    there is no output. the command just hang. don’t know why and the permissions are correct. web development

    shulato

    June 12, 2010 at 7:08 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: