#!usr/bin/perl use strict; use warnings; use RTF::Writer; use Data::Dumper; use RTF::Tokenizer; die "usage: $0 input output\n" unless @ARGV == 2; my $infile = shift; my $outfile = shift; my $tokenizer = RTF::Tokenizer->new(); $tokenizer->read_file($infile); my ( $token_type, $argument, $parameter ); { # reduce bogus warnings no warnings 'uninitialized'; # get past the header ( $token_type, $argument, $parameter ) = $tokenizer->get_token() until ($token_type eq 'control' and $argument eq 'pard'); } my @final; while ($token_type ne 'eof'){ ( $token_type, $argument, $parameter ) = $tokenizer->get_token(); push @final, $argument if $token_type eq 'text'; } my $rtf = RTF::Writer->new_to_file($outfile); $rtf->print(\@final); $rtf->close; __END__ {La dame p\'2eLa dameToc toc Il a ferm la porteLes lys du jardin sont fltrisQuel est donc ce mort qu'on emporteTu viens de toquer sa porteEt trotte trotteTrotte la petite souris Guillaume Apollinaire, AlcoolsVocabularytoc (n\'2em\'2e) tap; knocklys (n\'2em\'2e) lilyfltrir (v\'2eitr\'2e) to wilt; for a flower or beauty to fade;for a plant to withermort (adj\'2e, here used as a masc\'2e noun) deademporter (v\'2etr\'2e) to take a person or thing [somewhere];to take[out/away/etc\'2e] or carry[away] a thingtoquer (v\'2eitr\'2e) to tap; to knocktrotter (v\'2eitr\'2e) to trot; to scurrysouris (n\'2ef\'2e) mouse\'46ree TranslationClick click He closed the door / Garden lilies faded / Which body is today// You just tapped on the door / And tip toe / Taps the little mouse Translation Sean M\'2e Burke, 2001}