Chris,
Thank you so much! I tried it on a sample of my document and it works.  It 
did it in a way I wasn't expecting, but for the structure of my document it 
works.  I was thinking it about adding 1 to the numeric value of the end of 
the string.  Your script renumbers them starting with the counter value. 
 So it looks like I could just run it on the entire document or change the 
counter start value and highlight the section of the document from the 
duplicate to the end. In then end, this will be more useful to me since I 
can let my attribute name be duplicated until I'm ready to number them with 
your script so I don't have to correct any duplicate or erroneous id #s.
Thank you,
Michael

On Sunday, June 12, 2016 at 6:01:01 AM UTC-4, Christopher Stone wrote:
>
> On Jun 11, 2016, at 18:36, Michael Baker <michael...@gmail.com 
> <javascript:>> 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