<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Don’t copy that line. Just its results.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><blockquote type="cite" class="clean_bq"><div><div><blockquote><blockquote><font size="2"><span style="font-size: 10pt;"><font face="Courier New">16<br>17<br></font><font face="Helvetica, Verdana, Arial">[…snip...]<br></font><font face="Courier New">31<br>32</font></span></font></blockquote></blockquote></div></div></blockquote></div> <div id="bloop_sign_1424464342004998912" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"> <br>Graham P Heath<br><br></div></div> <br><p style="color:#000;">On February 20, 2015 at 1:16:44 PM, jgalt (<a href="mailto:jgaltusa@gmail.com">jgaltusa@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>






<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">Thanks Graham, that worked great but I am having
one problem.  The first line of your formula gets placed into
my first placeholder.<br>
<br>
Example: <PortalObj portalFlags="16" numOfRows="1" initialRow=$
seq 16 32><br>
<br>
<br>
On 2/20/15 9:41 AM, "Graham P Heath" <<a href="graham.p.heath@gmail.com">graham.p.heath@gmail.com</a>>
wrote:<br>
<br></span></font>
<blockquote><font size="2"><font face="Helvetica, Verdana, Arial"><span style="font-size:10pt">You can
combine Multiple Carets and Copy + Paste to achieve this
easily.<br>
<br>
Find a list of the numbers you want to use, I assume you’re capable
of generating the list in some way, but I like using the `seq`
command in the terminal such as:<br>
<br></span></font></font>
<blockquote><font size="2"><span style="font-size:10pt"><font face="Courier New">$ seq 16 32<br>
16<br>
17<br></font><font face="Helvetica, Verdana, Arial">[…snip...]<br></font><font face="Courier New">31<br>
32<br></font></span></font></blockquote>
<font size="2"><span style="font-size:10pt"><font face="Helvetica, Verdana, Arial"><br>
Note: It is important that they be separated by new line
characters.<br>
<br>
Copy this list.<br>
<br>
Select your first placeholder: “##"<br>
<br></font> <font face="Courier, Courier New"> <PortalOBj
portalFlags="16" numbOfRows="1" initialRow=“<font color="#009051">##</font>”><br></font><font face="Helvetica, Verdana, Arial"><br>
Press Control + W, this selects the next placeholder. Repeat until
your selection contains all of your placeholders.<br>
<br>
Paste.<br>
<br>
Graham P Heath<br>
<br>
 <br>
<br>
On February 20, 2015 at 8:29:30 AM, René Schwaiger (<a href="sanssecours@f-m.fm">sanssecours@f-m.fm</a>) wrote:<br>
 <br></font></span></font>
<blockquote><font size="2"><span style="font-size:10pt"><font face="Helvetica, Verdana, Arial">Hi jgaltUSA,<br>
<br>
> On 20 Feb 2015, at 9:50 , jgaltUSA <<a href="jgaltUSA@gmail.com">jgaltUSA@gmail.com</a>> wrote:<br>
>  <br>
> I am a newbie to textmate and I am trying to perform a find
and replace. I want to replace the matched text with a sequential
number.  <br>
>  <br>
> Here is my current replacement string: $1##$2  <br>
>  <br>
> How can I replace the ## with a sequential number?
 <br>
<br>
I do not think that what you want is possible using only regular
expressions and “Find & Replace”. It is possible and not to
complex using a programming language. The following code does what
you want:<br>
<br>
    #!/usr/bin/env python<br>
<br>
    from re import compile<br>
    from sys import stdin, stdout<br>
<br>
    regex = compile(<br>
        """(<PortalOBj
portalFlags="16" numbOfRows="1" initialRow=")\d+(">)""")<br>
    index = 16<br>
<br>
    def create_subtitute_function():<br>
        def
substitute(match):<br>
            global
index<br>
            replacement
= "{}{}{}".format(match.group(1), index, match.group(2))<br>
            index
+= 1<br>
            return
replacement<br>
<br>
        return
substitute<br>
<br>
    text =
regex.sub(create_subtitute_function(), stdin.read())<br>
    stdout.write(text)<br>
<br>
I attached a bundle which contains a command that uses the above
code. To install the bundle just double click it. You can apply the
substitution on some text by pressing the key combination “^⌥⌘R”.
Since the above is my code I would be careful when you use the
command though :).<br>
<br>
> For example, I want the first sequential number to be 16.
 <br>
>  <br>
> Here is a screen capture:   <br>
>  <br>
> Thanks!<br>
<br>
Kind regards,<br>
  René<br>
<br>
P.S.: You can create a screenshot of a single window by using the
key combination “⇧⌘4”. After that just hit “Space” and a click on
the window you would like to make a screenshot of. This way you do
not need to crop the picture.<br>
<br></font></span></font>
<hr align="center" size="3" width="100%">
<font size="2"><span style="font-size:10pt"><font face="Helvetica, Verdana, Arial"><br>
_______________________________________________<br>
textmate mailing list<br>
<a href="textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>

<a href="http://lists.macromates.com/listinfo/textmate">http://lists.macromates.com/listinfo/textmate</a><br>
</font></span></font></blockquote>
<font size="2"><span style="font-size:10pt"><font face="Helvetica, Verdana, Arial"><br></font></span></font>
<hr align="center" size="3" width="95%">
<font size="1"><font face="Andale Mono"><span style="font-size:9pt"><br>
_______________________________________________<br>
textmate mailing list<br>
<a href="textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>

<a href="http://lists.macromates.com/listinfo/textmate">http://lists.macromates.com/listinfo/textmate</a><br>
</span></font></font></blockquote>



<br>_______________________________________________
<br>textmate mailing list
<br>textmate@lists.macromates.com
<br>http://lists.macromates.com/listinfo/textmate</div></div></span></blockquote></body></html>