Community
    • Login

    How to remove a specific range of row regardless of blank/empty lines using regex?

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 456 Views 1 Watching
    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.
    • lightning speedL Offline
      lightning speed
      last edited by

      Hi there,
      How to remove a specific range of rows, for example, need to remove lines 2-5 regardless of blank/empty lines or lines containing info. Many thanks

      Before

      1. 1a@3536
      2. 123abc@
      3. abc!153
      4. #@!af35
      5. ff@#123
      6. wt3ef@1
      7. 3*^tu12

      After

      1. 1a@3536
      2. ff@#123
      3. wt3ef@1
      4. 3*^tu12
      Paul WormerP 1 Reply Last reply Reply Quote 0
      • Paul WormerP Offline
        Paul Wormer @lightning speed
        last edited by

        @lightning-speed Find: (?-s)\A(.*\R){1}\K(.*\R){4} Replace: empty field

        lightning speedL 1 Reply Last reply Reply Quote 2
        • lightning speedL Offline
          lightning speed @Paul Wormer
          last edited by

          @Paul-Wormer
          It’s works perfectly. Many Thanks

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors