LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-25-2011, 01:15 AM   #1
zoghbi
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Rep: Reputation: Disabled
Lightbulb How to convert html to odt or doc using linux command line?


hi everybody
I need to convert a lot of html files to text formats (odt,doc ...) using command line because i need to use shell script to convert all my files in one time.

thanks in advance
 
Old 12-25-2011, 06:19 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
openoffice/libreoffice include batch-conversion ability.

Code:
libreoffice --headless --convert-to odt *.html
I don't know how well it handles the conversion though.

There are more options for converting to regular text. html2text, for example. Search your distro's repositories.

Last edited by David the H.; 12-25-2011 at 06:21 AM. Reason: addendum
 
Old 12-25-2011, 02:16 PM   #3
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Dehradun, Uttarakhand, India
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,412

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
Hey zoghbi,

To convert to odt it's pretty easy after installing pandoc.

Quote:
#pandoc -o output.html input.txt
Or you can like:

Quote:
#abiword --to=doc filename.odt
 
Old 12-25-2011, 03:26 PM   #4
zoghbi
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
thanks very much David the H, and Satyaveer Arya
the two method works well,
pandoc convert with a best quality directly to .doc or .docx
 
Old 12-25-2011, 03:34 PM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Dehradun, Uttarakhand, India
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,412

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
Hello zoghbi,

If you found our posts helpful, please don't forget to give your feedback and reputation....
 
Old 12-26-2011, 03:49 AM   #6
zoghbi
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
of course Satyaveer Arya, thanks million times,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line text file viewing and editing - .odt etc. mitchellray Linux - Newbie 1 04-14-2009 03:41 PM
convert odt or .doc into html linuxmandrake Linux - Software 6 02-23-2008 03:48 AM
convert doc to pdf in command line yumener Linux - Software 4 04-28-2006 08:23 AM
command line utility to convert between formats like .doc, .sxw, .rtf and others? bigtpumped Linux - Software 1 09-12-2005 09:54 PM


All times are GMT -5. The time now is 02:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration