Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to replace "a line containing a particular word" with "empty line" in notepad++

    Help wanted · · · – – – · · ·
    notepad++
    2
    2
    326
    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.
    • Himanshu Sindhi
      Himanshu Sindhi last edited by Himanshu Sindhi

      I have a file like this…

      Virtual
      1 ) Fundamental
      2 ) Implied
      3 ) Indirect
      4 ) Authentic
      Correct Answer: Authentic
      Candidate Answer: Authentic
      Rustic
      1 ) Homely
      2 ) Simple
      3 ) Urban
      4 ) Plain
      Correct Answer: Urban
      Candidate Answer: Urban
      Barren
      1 ) Fertile
      2 ) Depleted
      3 ) Empty
      4 ) Waste
      Correct Answer: Fertile
      Candidate Answer: Empty

      Now I want to remove the lines containing “Candidate Answer: xyz” with an empty line.
      Like this…

      Virtual
      1 ) Fundamental
      2 ) Implied
      3 ) Indirect
      4 ) Authentic
      Correct Answer: Authentic

      Rustic
      1 ) Homely
      2 ) Simple
      3 ) Urban
      4 ) Plain
      Correct Answer: Urban

      Barren
      1 ) Fertile
      2 ) Depleted
      3 ) Empty
      4 ) Waste
      Correct Answer: Fertile

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @Himanshu Sindhi last edited by

        @Himanshu-Sindhi

        I would certainly try:

        Find: (?s-i)^Candidate Answer: .+\R
        Replace: nothing
        Search mode: Regular expression

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors