convert rtf to text

142 views
Skip to first unread message

Bee

unread,
Mar 1, 2009, 9:26:18 PM3/1/09
to vim...@googlegroups.com
I have found textutil.vim for the Mac that will convert .rtf to
plain text.

Is there a vim script to convert .rtf to plain text for linux?

Also is there a vim script to convert .doc to plain text for linux?

--
Bill Muench
Santa Cruz, California

Tom

unread,
Mar 2, 2009, 7:27:52 AM3/2/09
to vim_use
> I have found  textutil.vim  for the Mac that will convert .rtf to  
> plain text.

I don't know that plugin but I would assume that the conversion isn't
done in vimscript but by an external programm. So the question rather
is, which program could you use to convert the file. You could then
use eg ":read !converter filename" in a scratch buffer to read the
file -- untested. When you run the filter on the buffer containing the
file make sure not to save it under the original name. :-)

> Is there a vim script to convert .rtf to plain text for linux?

I think unrtf handles rtf. I don't know if it converts directly to
plain text though. According to http://www.gnu.org/software/unrtf/unrtf.html
it doesn't but you could run the html output through lynx I guess.

> Also is there a vim script to convert .doc to plain text for linux?

antiword does that. wv would be another option -- I have never used
myself though.

Other options could be found here:
http://freshmeat.net/search/?q=word+text

I don't know if there are plugins that use those converters or if you
have to write your own command/function that does that. Hm, you might
want to check out this vimtip "View and diff MS Word files"[1] that
provides some help with that.

Tom.


[1] http://vim.wikia.com/wiki/View_and_diff_MS_Word_files

Bee

unread,
Mar 3, 2009, 12:30:30 PM3/3/09
to vim...@googlegroups.com
On Mar 3, 2009, at 2:28 AM, Tom wrote:

>> I have found textutil.vim for the Mac that will convert .rtf to
>> plain text.
>>
>
> I don't know that plugin but I would assume that the conversion isn't
> done in vimscript but by an external programm.
>

Yes, it uses the MacOS "textutil" cli that does many conversions. It
is like antiword, unrtf and more.


>> Is there a vim script to convert .rtf to plain text for linux?
>>
>
> I think unrtf handles rtf.
>

>> Also is there a vim script to convert .doc to plain text for linux?
>>
> antiword does that. wv would be another option
>

Thank you, I will look at these.
--
Bill
Santa Cruz, California

Reply all
Reply to author
Forward
0 new messages