Delete Every line with that Word

后端 未结 3 948
生来不讨喜
生来不讨喜 2021-01-29 10:15

I want to delete the whole line if the line contains a specific word for example \"cat\".

If \"cat\" is in this line, delete the whole

3条回答
  •  旧时难觅i
    2021-01-29 11:09

    It is a two step process in notepad++. First do a regex replace

    Find what: ^(.*?)(cat)(.*?)$
    Replace with: 
    

    Next do a extended replace with

    Find what: \r\n\r\n
    Replace with: \r\n
    

    Assuming your file was created on Windows. However this will also remove all lines that previously had no content.

    Edit: Probably better to do the bookmark thing the other guy suggested.

提交回复
热议问题