• Login
Community
  • Login

Sort by line possible this way?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 537 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.
  • P
    Peter Maasakkers
    last edited by Jan 27, 2023, 8:00 PM

    Hi,

    Is this possible.

    I have a text with a lot of lines (200k+)
    I want to sort the lines with more then 3 times the same start words in the line.

    For example:

    This is a test line.
    This is a test line to show.
    This is a test line to show you.

    So i want to bookmark/delete ALL lines that have more than 3 same start words AT ONCE.

    Is this possible?

    Thnx

    P 1 Reply Last reply Jan 27, 2023, 8:08 PM Reply Quote 0
    • P
      PeterJones @Peter Maasakkers
      last edited by PeterJones Jan 27, 2023, 8:10 PM Jan 27, 2023, 8:08 PM

      @Peter-Maasakkers ,

      Since it’s sorted, that makes it quite doable.

      With the expanded data set, which has examples of mathching one, two, three, or four words from the beginning of the line:

      Matching two words.
      Matching two.
      One match.
      One similar word.
      The last three match mostly.
      The last three match somewhat.
      The last three match with four words as well.
      This is a single line.
      This is a test line to show you.
      This is a test line to show.
      This is a test line.
      This only matches three.
      This only matches with three.
      

      8dab9b5a-ee19-46e0-8892-c5efd1e8db57-image.png

      FIND = (?-s)^(\w+ \w+ \w+ \w+).*$\R(\1.*(\R|\Z))+

      That can be used to Mark/bookmark, or if you then replace with the empty string, it could be a replacement instead of a bookmarking.

      ----

      Useful References

      • Please Read Before Posting
      • Template for Search/Replace Questions
      • Formatting Forum Posts
      • Notepad++ Online User Manual: Searching/Regex
      • FAQ: Where to find other regular expressions (regex) documentation
      1 Reply Last reply Reply Quote 3
      • P
        Peter Maasakkers
        last edited by Jan 27, 2023, 8:36 PM

        Thnx a lot!

        A 1 Reply Last reply Jan 27, 2023, 8:44 PM Reply Quote 0
        • A
          Alan Kilborn @Peter Maasakkers
          last edited by Jan 27, 2023, 8:44 PM

          @Peter-Maasakkers

          Contrary to the title, this has nothing to do with sorting.

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