{"id":2243,"date":"2018-06-05T10:06:30","date_gmt":"2018-06-05T10:06:30","guid":{"rendered":"http:\/\/galhano.com\/blog\/?p=2243"},"modified":"2018-06-05T10:06:30","modified_gmt":"2018-06-05T10:06:30","slug":"find-duplicates-and-delete-all-in-notepad","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=2243","title":{"rendered":"Find duplicates and delete all in notepad++"},"content":{"rendered":"<p>example:<code>epshetsky@test.com,<br \/>\nrek4@test.com,<br \/>\nrajesh1239@test.com,<br \/>\nmohanraj@test.com,<br \/>\nsam@test.com,<br \/>\nnithin@test.com,<br \/>\nmidhunvintech@test.com,<br \/>\nkarthickgm27@test.com,<br \/>\nrajesh1239@test.com,<br \/>\nmohanraj@test.com,<br \/>\nnithin@test.com,<\/code><\/p>\n<p>I need results back like<\/p>\n<p><code>epshetsky@test.com,<br \/>\nrek4@test.com,<br \/>\nsam@test.com,<br \/>\nnithin@test.com,<br \/>\nmidhunvintech@test.com,<br \/>\nkarthickgm27@test.com,<\/code><\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li>sort line with Edit -&gt; Line Operations -&gt; Sort Lines Lexicographically ascending<\/li>\n<li>do a Find \/ Replace:\n<ul>\n<li><strong>Find What:<\/strong> <code>^(.*\\r?\\n)\\1+<\/code><\/li>\n<li><strong>Replace with:<\/strong> (Nothing, leave empty)<\/li>\n<li>Check <strong>Regular Expression<\/strong> in the lower left<\/li>\n<li>Click Replace All<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>How it works: The sorting puts the duplicates behind each other. The find matches a line <code>^(.*\\r?\\n)<\/code> and captures the line in <code>\\1<\/code> then it continues and tries to find <code>\\1<\/code> one or more times (<code>+<\/code>) behind the first match. Such a block of duplicates (if it exists) is replaced with nothing.<\/p>\n<p>The <code>\\r?\\n<\/code> should deal nicely with Windows and Unix lineendings.<\/p>\n<p>&nbsp;<\/p>\n<p>https:\/\/stackoverflow.com\/questions\/35329122\/find-duplicates-and-delete-all-in-notepad<\/p>\n","protected":false},"excerpt":{"rendered":"<p>example:epshetsky@test.com, rek4@test.com, rajesh1239@test.com, mohanraj@test.com, sam@test.com, nithin@test.com, midhunvintech@test.com, karthickgm27@test.com, rajesh1239@test.com, mohanraj@test.com, nithin@test.com, I need results back like epshetsky@test.com, rek4@test.com, sam@test.com, nithin@test.com, midhunvintech@test.com, karthickgm27@test.com, &nbsp; sort line with Edit -&gt; Line Operations -&gt; Sort Lines Lexicographically ascending do a Find \/ Replace: Find What: ^(.*\\r?\\n)\\1+ Replace with: (Nothing, leave empty) Check Regular Expression in the lower left [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[218,42],"tags":[],"class_list":["post-2243","post","type-post","status-publish","format-standard","hentry","category-notepad","category-utils","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2243"}],"version-history":[{"count":1,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2243\/revisions"}],"predecessor-version":[{"id":2244,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2243\/revisions\/2244"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2243"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}