Thank you very much, antiword worked fine.
When coping with the rtf thing, I encountered a problem.
I used the script that comes in the module, but as I didn't understand I
modified it to:

#!/usr/bin/perl
require RTF::TEXT::Converter;
my $inputfile="document.rtf";
my $outputfile="document.txt";

open(IN,"<$inputfile") or die;
open(OUT,">$outputfile") or die;
my $self = new RTF::TEXT::Converter(Output => \*OUT);
foreach my $inputfile (@ARGV) {
 $self->parse_stream($outputfile);
}
close(IN);
close(OUT);

What is wrong whith this script?








----- Original Message -----
From: "Richard Morse" <[EMAIL PROTECTED]>
To: "Alejandro Santillan Iturres" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Friday, October 14, 2005 6:00 PM
Subject: Re: convert winword .doc to .txt, or .rtf to .txt


For RTF, search.cpan.org search for RTF returns RTF::TEXT::Converter.

Re .doc files, if nothing else there are programs such as antiword
which you could use to get the text.

HTH,
Ricky

On Oct 14, 2005, at 4:25 PM, Alejandro Santillan Iturres wrote:

> I need to manipulate a file in windows word format (or .rtf). The
> script
> receives an uploaded file and need to count words, replace words,
> reformat
> spaces, tabs and \n's and publish it on the web. For this sake I need
> first
> convert the file to plain txt format.
>
> I did it successfully in a windows XP machine using Win32::OLE without
> problem, but this script will run on a linux machine, and I wasn't able
> to install the Win32::OLE module on the linux machine because of an
> error in
> a call to the IsWinNT subroutine.
>
> Any idea what to do to convert .doc to .txt ?
> Maybe some reg exp will do the work?
> (also .rtf to .txt is desirable).
>
> Thank you!
>
> Alejandro
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.0/134 - Release Date: 14/10/2005


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to