| User: editor -- 2008-05-24 << 151 153 >> |
| Hits: 457 |
| Type: Advanced search and replace |
| Search all Advanced search and replace examples |
| Description: |
| Can I translate all the IP address to country in a text file? |
| Input Sample: |
| This is ip address 133.2.1.2 The second ip address is 202.1.1.8 |
| Output Sample: |
| This is ip address 133.2.1.2( Japan ) The second ip address is 202.1.1.8( Australia ) |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| 1. ctrl-o open source file 2. ctrl-h open 'Replace' dialog in 'Replace' page, * set 'Search for Pattern' to: * set 'Replace with Pattern' to: 3. click 'Replace', ok! Note: \d+\.\d+\.\d+\.\d+ is regular expression, stands for ip address. ip2country($match) means change matched ip address to country name. ============== P.S. To avoid inputing above text manually, you can also use menu "Replace->Replace by Template->Misc->Convert IP Address to Country Name" menu directly. |
| Download Script: scripts/152.rst.zip |
Screenshot 1: Replace_Window |
Similar Examples: |
| How to extract all IP address from a text file? (74%) How to extract all html address from a text file? (68%) How to extract all email addresses from many text files? (67%) How to add a port 80 for all IP addresses in a text file? (64%) How to reverse all cases of letters in a text file? (63%) How to sort all lines of ip addresses in a text file? (61%) Can I download by all url addresses which are listed in a text file? (61%) How to extract all odd columns 1,3,5,... from a text file? (60%) |
Check Demo of Advanced search and replace |
| Keywords: |
| ddd translate odd convert ip address trans ip address template dir convert count replace translate ip and address ip address replace regular expression for replace in change text file and replace to change the replace ip in text file replace ip |