Community
    • Login

    How to delete a line ( and also the next line) that contains a specific word ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    linedelete text
    2 Posts 2 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Life's Hacks.L
      Life's Hacks.
      last edited by

      **Let’s say for example we have this text and I want to delete every line that containts" delete me " and also the next line **

      a random text here1111
      a random text here2222
      a random text here delete me3333
      a random text here 4444
      delete me a random text here5555
      a randomtext66666

      **So after applying what I want , the text is gonna be like this : **

      a random text here1111
      a random text here2222

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Life's Hacks.
        last edited by

        @Life’s-Hacks.

        Something like this could work:

        Find-what zone: (?-s)^.*?delete me.*\R.*\R
        Replace-with zone: make sure this is EMPTY
        Wrap-around checkbox: ticked
        Search-mode: Regular expression
        Action: Press Replace All button

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors