Something like duplicate in Notepad++
-
Hello community, I hope to find some help here. Here is the task:
I have 2 mail lists, both lists have the same data, for example:
#1 is a mail lists, for example, xyz@gmail.com
#2 is a mail:name surname lists, for example, abc@gmail.com:ABC CDE
Note: I want to use/extract the mail:name surname list.
Note: it is not necessary to have 2 text files, I can copy the #1 list in the #2 list and I will have a 1 text file.
Here is the question:
How can I find the #1 mail lists in the #2 mail:name surname lists?.
Is possible to do this task with Notepad++?.
Thanks.
-
@Danico-Danico said in Something like duplicate in Notepad++:
How can I find the #1 mail lists in the #2 mail:name surname lists?.
Hello, welcome to the NPP community. If I understand your request correctly you want to extract the abc@gmail.com:ABC DEF line in file #2 ONLY when the same email address occurs in file #1. If that’s correct it is a fairly simple process. You actually had the start of the process, namely combining the 2 files.
So the steps are:
- combine the 2 files, insert contents of file #1 inside file #2. This can be either at the start or end of file #2, doesn’t matter.
- Use the line sorting function, under Edit, then Line operations. Select “sort lines lexicographically descending”, very important.
- So now the contents of the file will have the line you want followed by the same email line below it if it existed in file #1. See my example below.
- Now we use a "marking regex to find the lines where both bits of data exist. So use Search, then Mark.
Find What:^(.+):.+\R(?=\1)
Search Mode MUST be “regular expression”.
Select “bookmark line” and then click on “Mark all”. Only those lines which have data from both files should be marked 9only first line of the pair is marked). - Select “Bookmark” found under “Search”, then use “copy bookmarked lines” to select those lines highlighted. Copy these lines into a new file.
That should be all. If you are unsure of any steps or I have your request wrong, please do respond with more details.
Terry
def@gmail.com:de f def@gmail.com cde@gmail.com:cd e cde@gmail.com abc@gmail.com:ABC CDE abc@gmail.com a1b2@gmail.com:a1 b2 a1b2@gmail.com 345@gmail.com:3 45 2b3c@gmail.com:2b 3c 123@gmail.com:1 23
-
It works, thanks a lot.