Hi, @mohammad-al-thobiti and All,
Again, I’m going to simplify the problem, using a Python script, called Replacements_Lists.py, listed below :
''' Refer to : https://community.notepad-plus-plus.org/topic/19889/ - Given TWO files : - A MAIN one, located in the MAIN view, containing a LIST of strings or lines - A SECOND one, located in the SECONDARY view, containing : - A LIST of strings to REPLACE, EACH followed with a TABULATION and its CORRESPONDING replacement string This script replaces EACH expression of the MAIN file by the CORRESPONDING replacement string, found in the SECONDARY file NOTES : - The REPLACEMENT strings may be ABSENT IF you do NOT write anything AFTER the TABULATION separator. Thus, these SPECIFIC searched strings will be DELETED - The strings of the MAIN file, NOT found in the SECONDARY file, are simply REWRITTEN - The LEADING strings of the SECONDARY file, NOT found in the MAIN file, are simply NOT used - The list of the DIFFeRENT ranges < SEARCHED string > \t < REPLACEMENT string > must END with a FINAL line-break or NOTHING else ( \z ) ''' from Npp import editor1, editor2 replacements = dict(line.split('\t') for line in editor2.getText().splitlines() if line) def replace_with(m): try: r = replacements[m.group()] except KeyError: r = m.group() return r editor1.rereplace('(?-s).+', replace_with)So, just follow this road map :
Open your entire file containing all your records ( about 181,170 ) in the main view
Open your file containing the 1.027 lines, whose all the occurrences must be deleted in the main file
Move this file in the secondary view ( IMPORTANT )
I suppose that these two files ONLY contains main domain names, one per line
Run the Edit > Blank operations > Trim Leading and Trailing Space option for the two files
Now, in the secondary view, use this regex S/R :
SEARCH (?<=.)$
REPLACE \t
in order to produce a correct replacement list for some domain’s names by nothing
Move back to your file in the main view
Run the Plugins > Python Script > Scripts > Replacements_List.py option
=> Immediately, all the lines, of the main view, which match one of the lines of the secondary view, have been replaced with an empty line
Run the Edit > Line Operations > Remove Empty Lines
Finally save your uptaded file, in the main view
Voilà !
Best Regards,
guy038
P.S. :
If you need to install the Python Script plugin, follow this FAQ