in reply to Re: How can I find a line in a RTF file?
in thread How can I find a line in a RTF file?
#!/usr/bin/perl use Modern::Perl; use RTF::TEXT::Converter; my $string; my $object = RTF::TEXT::Converter->new(output => \$string); $object->parse_stream( '..\Policies\Test\000144027.rtf' ); chomp $string; my @string = split("\n", $string); my $number_of_sigs = 0; foreach my $line (@string) { chomp $line; if ($line =~ m/Date of Last Update:(.*)/){ my $date_of_last_update = $1; $date_of_last_update =~ s/^\s+//; print "Date of last update is: $date_of_last_update\n"; } if ($line =~ m/Document #:(.*)/){ print "\nDocument number is $1\n"; } # Sign-Off Approvals if ($line =~/'Sign-Off Approvals'/){ print $line; $number_of_sigs ++; } # next; #next if $line !~ /\w+/; #next if $line =~ /^\_+\/\_+\/\_+$/; #say $line; } print "number of signatures is $number_of_sigs \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How can I find a line in a RTF file?
by james28909 (Deacon) on Aug 10, 2014 at 00:21 UTC | |
|
Re^3: How can I find a line in a RTF file?
by james28909 (Deacon) on Aug 10, 2014 at 00:24 UTC |