Page 1 of 1

using afr to increment values

Posted: Wed Mar 30, 2005 8:46 am
by benhab
Hi, I just found your product and so far in my testing is does everything that i'd like it to, except for one thing. I'm currently working with some dns zone files which have a format of

@ IN SOA (
18 ; Serial number
900 ; Refresh
600 ; Retry
86400 ; Expire
3600 ) ; Minimum TTL
A nnn.nnn.nnn.nnn
MX 10 mail
mail A nn.nn.nnn.n
www A nnn.nnn.nnn.nnn

What i'm having a hard time wraping my head around is how to take the "Serial Number" (in this case 18, but could be different for each file) and increment it's value by 1. (ie 18 -> 19). Is there a way that AFR can do this or am I back to writing code? If it does than you just got yourselves another customer!!!

Thanks in advance,

Posted: Wed Mar 30, 2005 1:41 pm
by Abacre

It's not possible to do now with AFR, but I know how to quickly
implement it (we already have a pretty framework for it). We will develop it this week. I will send you a message

Posted: Mon Apr 04, 2005 5:31 pm
by Abacre

Ok, we implemented the feature.

Please download the latest version of the program:

This is only updated EXE file. You need to extract executable file from
zip archive into folder where the program is installed. So you will
replace old executable file by this new one.

Start the program. In main menu Action - Options - Batch replace:
check ON modifier E (which means evaluate text in <>).

Then go to Batch replace tab of the main window
and put into
Search for:
(\w+) ; Serial number

Replace with:
<$1+1>; Serial number

That's all. I verified and it perfectly works.

Note that if you are sure that the line starts with serial number then
you may use ^ before the regular expression. ^ means start of the
line. So in this case you should put ^(\w+) ; Serial number into
Search for field.

Tell me does it work now?

awesome!!! couple of tweeks works great!

Posted: Tue Apr 05, 2005 7:07 am
by benhab
Thank Roman so very much, can't tell you how much time this saved me. We'll definetly be purchasing the product. And heartily recommending it to all who ask.

FYI... I used the follow regexs to get it to work.

Search For:
(.*\d*.*);.*Serial number

Replace with:
<$1+1>; Serial number\r\n

Thanks again,
Ben Habing
Infrastructure Architect
Genesys Networks Inc.

Posted: Wed Apr 20, 2005 1:26 pm
by Abacre
BTW, just a quick note: in official version of the program we will use
<%= =%>
for evaluating the expressions instead of < > described here.