Notepad++ Remove line with specific word in multiple files within a directory

谁说胖子不能爱 提交于 2020-01-24 17:25:06

问题


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).



来源:https://stackoverflow.com/questions/20369180/notepad-remove-line-with-specific-word-in-multiple-files-within-a-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!