On Friday 16 April 2004 11:33 am, Wiggins d Anconia wrote:
> > I have a bunch of rtf documents that I need to be able to work with on my
> > linux box. I want to convert them to text and still be able to have
>
> the white
>
> > space. At any rate I tried the before mentioned module and this was my
> > code...
> >
> > #!/usr/bin/perl
> > use strict;
> > use warnings;
> > use RTF::TEXT::Converter;
> > my $object = RTF::TEXT::Converter -> new ( Output => \*STDOUT );
> > while ( <> ) {
> >   $object -> parse_stream( $_ );
> > }
> >
> > this is my output....
> >
> > [EMAIL PROTECTED] ups]$ ./convert.pl nov.rtf
> > Can't open '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss
> > Arial;}}{\colortbl;\red0\green0\blue0;}{\stylesheet{\fs16\lang1033
>
> \snext0
>
> > Normal;}}
> > ' (No such file or directory) at
>
> /usr/lib/perl5/site_perl/5.8.3/RTF/Parser.pm
>
> > line 34, <> line 1.
> >
> > Any suggestions?
>
> 'parse_stream' appears to take a filehandle, I believe you are looking
> for 'parse_string'.... Or you could pass *STDIN to parse_stream and drop
> the while loop.
>
> HTH,
It did perfectly. I was using the html docs and my eyes crossed they had both 
the stream and string in two different blocks that beyond those words where 
indentical. Thanks.

It turned any white space into new lines though.
so if it was like this...
company                 somecompany
ref num                 some ref num
addresss                        some address

it displayed it as 
company
refnum
address
somecompany
some ref num
some address.

Any Ideas on how to get around that?

Paul


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to