On Jun 11, 2016, at 18:36, Michael Baker <michaeldbake...@gmail.com 
<mailto:michaeldbake...@gmail.com>> wrote:
> I'm sorry if I don't understand the perl script enough to follow your attempt 
> helping me.
> It might be I didn't explain my task well enough.  In case it helps I'll be a 
> little more descriptive.


Hey Michael,

When dealing with find/replace problems it's always a good idea to provide one 
or more representative data samples.

Verbal descriptions just don't do it.  People need real data to visualize and 
to test with.

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";
   } else {
      print;
   }
}

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" 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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.

Reply via email to