Hello all!


I have a question about a perl filter. I have a complicate table with a 
frame around, which consists of a <td with a rowspan until the bottom of 
the table. Each time I insert new rows, I have to count the table rows 
<tr again to adapt the rowspan to my table.

My idea of a perl filter is not working: first I am reading the selected 
table in my file counting the table rows. Second I want to insert the 
number I counted into the rowspan=" ... "


#!/usr/bin/perl

use strict;
use warnings;

my $rowcount=0;

while (<>)    {
     if (/<tr/g) {
         $rowcount++;
     }
}

while (<>) {
     s/(rowspan=")\d*"/$1$rowcount"/g if $rowcount;
     print;
}

But apparently this is not working. Probably it is not possible to read 
in two times the lines with while (<>) in Perl??? Now my idea would be 
to read in the lines backwards with a module like:

File::ReadBackwards

and at the end (on top) insert the counted <tr lines ... Would this be 
possible? (: A real challenge to Ronald for example :)



thank you for your help



marek

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "[email protected]" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to