- Ctrl+H
- Find what:
^(.+)(\R)([\s\S]+?)\1\R?
- Replace with:
$1$2$3
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # begining of line
( # start group 1
.+ # 1 or more any character but newline
) # end group 1
(\R) # group 2, any kind of linebreak
( # start group 3
[\s\S]+? # 1 or more any character, not greedy
) # end group 3
\1 # same content as group 1
\R? # optional linebreak, to take care of last line, may be without linebreak.
Replacement:
$1 # content of group 1
$2 # content of group 2
$3 # content of group 3
Result for given example:
1
5
3
9
4
NOTICE: You have to hit Replace all as many times as needed, it doesn't remove all the duplicates in one time.