Page 1 of 1

Replacing phone numbers

Posted: Wed Oct 24, 2007 1:50 pm
by HoserDave
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

Re: Replacing phone numbers

Posted: Wed Oct 24, 2007 3:32 pm
by Abacre
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.

Re: Replacing phone numbers

Posted: Fri Oct 26, 2007 3:44 pm
by HoserDave
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

Re: Replacing phone numbers

Posted: Fri Oct 26, 2007 4:59 pm
by Abacre
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.