Find duplicates and delete all in notepad++
我有多个电子邮件地址。 我需要找到并删除所有(包括找到的)。 这在记事本++中是否可行?
示例:
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
我需要结果像
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
在记事本++中怎么办?
如果可以更改您可以执行的行的顺序:
-
找到什么:
^(.*
?
)\1+ - 替换为:(没什么,留空)
- 检查左下方的正则表达式
- 单击全部替换
工作原理:排序将重复项放在一起。该查找匹配一行
?
)
?
你需要textFX插件。然后,只需按照以下说明操作:
1 2 3 4 | Paste the text into Notepad++ (CTRL+V). ... Mark all the text (CTRL+A). ... Click TextFX → Click TextFX Tools → Click Sort lines case insensitive (at column) Duplicates and blank lines have been removed and the data has been sorted alphabetically. |
就个人而言,我会使用sort -i -u source> dest而不是notepad ++
你可以用
Click TextFX → Click TextFX Tools → Click Sort lines case insensitive (at column)
Duplicates and blank lines have been removed and the data has been sorted alphabetically.
如上所述。但是,我这样做的方式是因为我需要用空行替换重复项而不是删除行,一旦按字母顺序排序:
1 2 3 4 5 6 7 | REPLACE: ((^.*$)( ))(?=\k<1>) by $3 |
这将转换:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Shorts Shorts Shorts Shorts Shorts Shorts Two Pack Shorts Two Pack Signature Braces Signature Braces Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers Signature Cotton Trousers |
至:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Shorts Shorts Two Pack Signature Braces Signature Cotton Trousers |
这就是我这样做的原因,因为我特别需要这些线条。