Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
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:
247
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:
$match eq $previous
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 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%)
How to batch remove/delete first and last line of many text files?
(71%)
Check Demo of
Advanced search and replace
Keywords:
delete consecutive duplicate lines
adjacent lines
adjacent line
adjacent
previous
consecutive
onsecutive
duplicated
cut
duplicate lines
adjacent duplicate
keep first
replace duplicate lines
only first
replace duplicate
duplicate file
only search text
search and replace first