Notepad++ Remove line with specific word in multip

2019-07-10 04:41发布

问题:

I am trying to REMOVE lines in a MULTIPLE text files with a particular word. Is this possible in Notepad++?

At the moment, I can replace those lines with a blank line. However how do I remove them in multiple files within a directory? I tried the "Mark" method whereby we can remove lines however it seems only possible for single file.

Thanks!

回答1:

Go to Search > Find in Files menu (shortcut CTRL+Shift+F) and do the following:

  1. Find what:

    <Brand>Acer<\/Brand>\r?\n?
    
  2. Replace:

    [leave empty!]
    
  3. Directory: select the directory with your files

  4. Search mode: select radio button "Regular Expression"

  5. Then press Replace in Files (actually press first the Find All to be sure that it works, and then the Replace).



标签: notepad++