Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

876.Advanced search and replace -- How to remove/delete consecutive duplicate lines in a text file?

User: editor -- 2011-10-19          << 875  877 >>
Hits: 1991
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to remove/delete consecutive duplicate lines in a text file? If some adjacent lines are duplicated, only keep the first one.
Input Sample:
aaa
aaa
aaa
aaa
bbbb
bbbb
aaa
cccc
cccc
Output Sample:
aaa
bbbb
aaa
cccc
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open text file
2. ctrl-h open 'replace' dialog
* set 'replace unit' to 'Line'
* set 'if' to:

3. click 'replace', done.

Screenshot 1:  Replace_Window


Similar Examples:
How to auto remove/delete consecutive duplicate sentences or phrases in a text file? (82%)
How to remove duplicate lines from a text file? (80%)
How to delete duplicate lines of a text file? (80%)
How to remove consecutive duplicate words in multiple files? (77%)
How to remove partially duplicated lines in a text file? (77%)
How to sort and delete duplicate lines of a text file? (77%)
How to remove/delete unnecessary line breaks in a text file? (74%)
How to remove/delete all blank lines in a text file? (72%)

Check Demo of Advanced search and replace
Keywords:
delete consecutive duplicate lines  adjacent lines  adjacent line  adjacent  consecutive  onsecutive  previous  duplicated  cut  duplicate lines  adjacent duplicate  first duplicate  duplicated lines in a text file  keep lines  keep first  replace duplicate lines  only first  duplicate text