воскресенье, 20 сентября 2015 г.

Replacement of Word Press blog links in "one-click"

The method is:
Download the database, and make backup
Next, we need a couple of programs
uvFilesCorrector - mass text replacement in multiple text files
TextPipe - need to extract links from a text file, in our case - the data base, if there is no list of links that need to be replaced.
Excel - to sort the links and create a file to replace


1. Install and open the TextPipe (a good program to work with the text, there are a lot of things), in our case, we need a filter "Extract URL's", add it (in 'filters for use' tab)


After go to the second tab "Files to process" and add our database (making a copy, since the replacement will occur in the file), then press the "do."





We got a text file with all the links that are available in the database, but they are scattered, we also need to sort them by domain (for example by filehost or imagehost), copy the link and paste them into Excel, continue to do the sorting by column and clicking Sort and the filter \ Sort from A to Z, we obtain a list of links, filtered by domain. Copy the needed links and save the new Excel "book" in the second column, the fourth column to link to which we will need to be replaced (2 and 4 why I will explain below). You should get something like this:
(on left: link from database; on right: link for replacement)


2. Open the program uvFilesCorrector, click the Add button, adding that it is necessary to find (first) and that you want to replace (second), write values:


it is necessary to create a file replacement, click OK, then Save.
save the file with the extension .lst, this is our replacement file that has a certain structure,
open it in a text program and see where the "first" (a reference to be replaced), and where the "second" (a reference which needs to be replaced)


Then again go to Excel and paste in the first column, the second column we have links from the base, in the third column insert anything between the "first" and "second" - </ Find> in the fourth column we have links to replace, and the fifth column is inserted left of the line </ Replace> 1 </ Checked> </ xPath> </ Flags> </ Item>. Next duplicate the 1, 3 and 5 columns (A, C, E) by all replacements. In the end we should get the file:


Then we copy all of the columns and inserted into the text program to remove unnecessary tabulations:


Next, copy all the replacements lines and insert it in a file .lst, - we created a file ready for uvFilesCorrector, it should look something like this:


Now can start exactly replacement. Go to uvFilesCorrector, open the file that we need replace and add the folder where is our data base:


Click "Change" and wait,  2500 links need about 40 seconds to be replaced, the program may stop responding, but just wait. After replacing fill a new database and obtain the site with new links.

Комментариев нет:

Отправить комментарий