Apenas se os duplicadores forem consecutivos:
- Ctrl + H
- Encontre o que:
^(([^|]+[|][^|]+[|][^|]+)[|]?.*)\R
- Substituir por:
$1
- Substituir todos
Explicação:
^ : begining of line
( : start group 1
( : start group 2
[^|]+ : 1 or more NON pipe character |
[|] : a pipe
[^|]+ : 1 or more NON pipe character |
[|] : a pipe
[^|]+ : 1 or more NON pipe character |
) : end group 2
[|]? : a pipe, optional
.* : 0 or more any character but newline
) : end group 1
\R : any kind of line break
: backreference to group 2
- NÃO VERIFIQUE
. matches newline
Substituição:
$1 : content of group, the first dupplicate line
Resultado para o exemplo dado:
209.116.247.120|admin|default|Taiwan (TW)|Tai-pei|Taipei|Unknown|
209.116.49.130|admin|admin|China (CN)|Henan|Zhengzhou|Unknown
209.116.55.142|admin|admin|Korea, Republic of (KR)|Seoul-t'ukpyolsi|Seoul|Unknown
209.116.65.26|admin|admin|New Zealand (NZ)|Unknown|Unknown|Unknown