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
Replacing phone numbers
Re: Replacing phone numbers
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.
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
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

Thanks again!
Dave
Re: Replacing phone numbers
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.
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.