On Sun, Jun 12, 2016 at 05:00:59AM -0500, Christopher Stone wrote:
> This Perl filter will probably do the job for you and is fairly easy to 
> understand.
> 
> #!/usr/bin/env perl -sw
> 
> my $cntr = 1;
> 
> while (<>) {
>    if ( m!(^.*<document id="KyChr-DB-B-)(\d{3})(">.*)! ) {
>       print "$1".sprintf("%03d", $cntr++)."$3\n";

Alternatively, if you want to increment the existing value, rather than
using a new counter, replace
  $cntr++
with
  $2 + 1

>    } else {
>       print;
>    }
> }


Ronald

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to