LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-01-2007, 03:10 PM   #1
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Rep: Reputation: 15
How to extract Text from RTF files (or even DOC)


I regularly get files in very broken RTF format that I need to do a quick and dirty conversion to HTML. My current process is:

1) Open file in Open Office. Mark all, Copy to clipboard.
2) Open new, blank file in vi. Paste text into file.
3) Run sed script against file to do some quick and dirty formatting.

Step three runs great, I am quite happy with it. I would like to eliminate or simplify steps one and two.

Is there a way to extract all the text from a document from a command line that will work in a similar fashion to what I describe.

Thanks,

Skip
 
Old 03-01-2007, 05:33 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 69
Have you taken a look at UnRTF or rtf2xml?
 
Old 03-01-2007, 07:36 PM   #3
dinfli
LQ Newbie
 
Registered: Mar 2007
Posts: 5

Rep: Reputation: 0
I agree with #2! You can use some tools!
 
Old 03-02-2007, 07:37 AM   #4
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Original Poster
Rep: Reputation: 15
I will try those, but I was kind of hoping for a more general function, perhaps something in sed that could simply strip the text from an rtf file.
 
Old 03-02-2007, 12:43 PM   #5
tshrinivasan
Member
 
Registered: Jan 2006
Location: Chennai, Tamil nadu, India
Distribution: Debian Etch Testing
Posts: 117

Rep: Reputation: 16
antiword, catdoc, wvware

http://www.linux.com/article.pl?sid=06/02/22/201247
 
Old 03-02-2007, 12:57 PM   #6
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Original Poster
Rep: Reputation: 15
Thanks! Those look very useful.
 
  


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
a .doc , .rtf converter debdas Programming 15 01-27-2011 12:09 AM
Converting *.doc or *.rtf to PDF files Paulo Ges Programming 7 12-08-2006 09:07 AM
how to convert wordpad(rtf) doc to linux text file? kpachopoulos Linux - General 2 10-28-2005 10:53 AM
command line utility to convert between formats like .doc, .sxw, .rtf and others? bigtpumped Linux - Software 1 09-12-2005 09:54 PM
Converting PDF to text, rtf doc format saurya_s Linux - Software 2 06-16-2005 01:48 PM


All times are GMT -5. The time now is 04:14 AM.

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