Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1104.Advanced search and replace -- How to count apperance of distinct IP and remove specified IP range?

User: Adrian Jones -- 2013-07-15          << 1103  1105 >>
Hits: 3336
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How can I remove a known IP range from my extracted IP's? I am running a report on some data that leaves me with a list of IP's but there is a subset of IP's I want to ignore. Also, is there a way to remove duplicates but leave the number of hits - ie address 9.204.150.192 hitcount 2?
Input Sample:
173.37.137.69 
194.61.184.3 
9.204.150.192 
54.241.107.142 
194.61.184.3 
9.204.150.192
Output Sample:
173.37.137.69 
9.204.150.192 
54.241.107.142 
9.204.150.192
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume you want to remove all IP of 190.x.x.x-195.x.x.x 
1. ctrl-o open text file that contain IP list, one in each line 
2. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line' 
* set 'search for pattern' to: 
 
3. click 'replace', all 190-195 ip address will be removed 
4. select 'replace->replace by template->word frequency statistics->count and sort frequency of all line' menu 
5. click 'ok', and click 'replace', all lines will be sorted by frequency, and the duplicated IP are removed. 
 
Note: after the operation, system will generate 2 scripts automatically, you can save these 2 scripts into one script file(rst) and reuse it later.

Screenshot 1:  Replace_Window


Similar Examples:
How to count the occurrance of some specified words in many files? (61%)
How to count the appearance of 100 most commonly used words in an article? (56%)
How to count the number of consecutive lines with specified pattern? (55%)
How to change each line of data to the specified format? (53%)
How to count the number of lines under each specified pattern? (53%)
How to change a list of URL into specified hyperlink format in HTML? (52%)
How to batch rename files by remove everything after specificed string? (52%)
How to replace the 7th column with increasing numbers between the specified range? (51%)

Check Demo of Advanced search and replace
Keywords:
ips  running  remove duplicates  report  eus  sort frequency  count and sort frequency  scripts  frequency  word frequency statistics  generate ip address list from text  script to sort ip address in text file  sort ip range in text file  generate ip address list range  generate text file ip address range  generate ip address range text  generate text file with number range  sort and count each line