Mask a number Batch replace Reg Expression

General discussions about Advanced Find and Replace
Post Reply
bond007
Posts: 2
Joined: Thu Aug 23, 2007 8:40 pm

Mask a number Batch replace Reg Expression

Post by bond007 »

hi
i have about 100 files, and want to mask the customer number, as follows:

original:
<customer_number>123456789012</customer_number>

desired result:
<customer_number>********9012</customer_number>

I want all but last 4 digits to change to asterisks. Customer number is always 12 digits.

Can someone please help?

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Mask a number Batch replace Reg Expression

Post by Abacre »

Go to main menu - Action - Options - Batch Replace
check "Modifier M"
uncheck "Modifier S"
uncheck "Modifier G"

Go to Batch replace tab, check on "Use regular expressions".

Put into the grid:

Search for:
<customer_number>\d+(\d{4})</customer_number>
Replace with:
<customer_number>********$1</customer_number>

That's all I verified it works perfectly.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

bond007
Posts: 2
Joined: Thu Aug 23, 2007 8:40 pm

Re: Mask a number Batch replace Reg Expression

Post by bond007 »

Awesome. Thanks for your promt reply boss. Ticket closed :D

Post Reply