Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

853.Advanced search and replace -- How to replace all duplicate lines with some text?

User: Rodrigo -- 2011-09-12          << 852  854 >>
Hits: 4018
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace duplicate lines with text? The text have sequences of duplicate lines, how to maintain the first sentence and replace the duplicates with some text?
Input Sample:
This is an example. 
This is an example. 
This is an example. 
This is an example. 
This is an example. 
Other Example. 
Other Example. 
Other Example. 
Other Example.
Output Sample:
This is an example. 
hello. 
hello. 
hello. 
hello. 
Other Example. 
hello. 
hello. 
hello.
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 unit' to 'Line' 
* set 'replace with pattern' to: 
 
click 'advanced' tab, 
* set 'run following at the beginning of replace' to: 
 
* set 'run following for each matched unit' to: 
 
3. click 'replace', done. 
4. ctrl-s save to text file.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to remove duplicate lines from a text file? (74%)
How to remove partially duplicated lines in a text file? (74%)
How to delete duplicate lines of a text file? (74%)
How to sort and delete duplicate lines of a text file? (71%)
How to find and replace multiple line text? (66%)
How to replace the quoted text with lines from another file? (64%)
How to remove/delete consecutive duplicate lines in a text file? (64%)
How to remove/delete all blank lines in a text file? (64%)

Check Demo of Advanced search and replace
Keywords:
duplicates  replace duplicate lines with  sentence  replace duplicate lines  duplicate lines  toc  duplicate line  else  replace duplicate  duplicate  sentence of duplicate  replace duplicate sentence  duplicate sentence  beginning sentence  first duplicate  save duplicate lines  search and replace sentence  search for lines beginning