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 » Thu Aug 23, 2007 8:44 pm

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: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Re: Mask a number Batch replace Reg Expression

Post by Abacre » Thu Aug 23, 2007 8:48 pm

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 » Thu Aug 23, 2007 8:52 pm

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests