• Login
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 259 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.
  • L
    lightning speed
    last edited by Jul 14, 2023, 1:06 AM

    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
    P 1 Reply Last reply Jul 14, 2023, 10:10 AM Reply Quote 0
    • P
      Paul Wormer @lightning speed
      last edited by Jul 14, 2023, 10:10 AM

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

      L 1 Reply Last reply Jul 14, 2023, 10:56 PM Reply Quote 2
      • L
        lightning speed @Paul Wormer
        last edited by Jul 14, 2023, 10:56 PM

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

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