Replacing phone numbers

General discussions about Advanced Find and Replace
Post Reply
HoserDave
Posts: 2
Joined: Wed Oct 24, 2007 1:44 pm

Replacing phone numbers

Post by HoserDave » Wed Oct 24, 2007 1:50 pm

I have a very large website with phone numbers mixed into many of the pages. I need to change them en masse so that, for example, (202) 555-2356 ext. 4454 is now to become (202) 555-4454. Essentially, all listed ext. XXXX become the last 4 digits of the phone number. I also need to remove ext. XXXX from the listing. Therefore I need to search about 100,000 pages and change:

(202) 555-2356 ext. 4454
(202) 555-2356 ext. 5532

Into this:

(202) 555-4454
(202) 555-5532

Can advanced find and replace do this for me? And if so, how? Any help would be greatly appreciated and thanks in advance.

Dave

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

Re: Replacing phone numbers

Post by Abacre » Wed Oct 24, 2007 3:32 pm

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
(\(\d+\) \d+-)\d+ ext. (\d+)

Replace with:
$1$2

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

HoserDave
Posts: 2
Joined: Wed Oct 24, 2007 1:44 pm

Re: Replacing phone numbers

Post by HoserDave » Fri Oct 26, 2007 3:44 pm

Thanks Roman :). That's perfect. As a followup, is does AFR log which files it modifies? I'm going to run this on my development server but will need a way to know which files were modified so I can upload them to prod. Or....is AFR able to connect to and modify files on a unix server?

Thanks again!

Dave

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

Re: Replacing phone numbers

Post by Abacre » Fri Oct 26, 2007 4:59 pm

AFR shows modified files in Results. So you may use Action - Save Results As.. command.
You may save it as XML, TXT (tab or comma delimited files).

You can also use AFR from command line:
http://www.abacre.com/afr/manual/commandline.htm
So you may use -result command line parameter to save the modified files.

AFR does not have yet automatic logging like it's done on web servers (web servers logs). So you have to manually save the results.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests