Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

587.Advanced search and replace -- How to find out all lines that appeared specified number of times?

User: editor -- 2010-08-12          << 586  588 >>
Hits: 2125
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to find out all lines that appeared specified number of times? 
I have a text file that has many duplicated lines, how to keep all lines that has appearred 3 times, and remove other lines? 
Input Sample:
lineA 
lineB 
lineC 
lineA 
lineA 
lineB 
lineB
Output Sample:
lineA 
lineB 
lineA 
lineA 
lineB 
lineB 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file 
2. ctrl-h open replace window 
* set 'replace with pattern' to: 
 
* click 'advanced' page, set 'run following for each matched unit' to: 
 
3. click 'replace', done!

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to findout all lines that contain specified words in multiple files? (73%)
How to re-arrange lines with in a specified number of lines? (65%)
How to rip out all but line 1 and specified text? (64%)
How to sort all lines of text by specified keyword? (63%)
How to delete all lines appear in file B from file A? (62%)
How to count the number of english words that has specified number of chars? (62%)
How to remove all the lines that with odd line number for multiple files? (62%)
How to list out all the lines which has having specified keyword.  (62%)

Check Demo of Advanced search and replace
Keywords:
duplicated  toc  times  keep  duplicate  duplicat  dupl  find  values  clear  replace text with specified times  remove duplicated lines  keep lines  remove specified  keep number  advanced find and replace find  replace times  remove all number