On 25 Oct 2013, at 12:11, perdox <perryk...@gmail.com> wrote:

> ...I would like to find, in one Search and replace ALL of the <space 
> id=">,<space rid="> bits and add a prefix that is to be the number used in 
> the file name. So for example, I would end up with
> 
> <list id="P35-L1">
> <list id="P35-L2">
> <ref id="P35-R008”>

You can easily do this with a text filter.  Here’s one using Perl:

#!/usr/bin/perl
my $f = $ENV{BB_DOC_NAME}; # get the name of the front doc
# code to extract the number from the file name
(my $n = $f) =~ s~([^\d]+)~~g; # remove all non-digits
while(<>){
        s~ref id="~$&$n-~g;
        s~list id="~$&$n-~g;
        s~ref-type="~$&$n-~g;
        s~rid="~$&$n-~g;
        print;
}

# JD

-- 
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