Community

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

    Sort by line possible this way?

    Help wanted · · · – – – · · ·
    3
    4
    45
    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.
    • Peter Maasakkers
      Peter Maasakkers last edited by

      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

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @Peter Maasakkers last edited by PeterJones

        @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
        • Peter Maasakkers
          Peter Maasakkers last edited by

          Thnx a lot!

          Alan Kilborn 1 Reply Last reply Reply Quote 0
          • Alan Kilborn
            Alan Kilborn @Peter Maasakkers last edited by

            @Peter-Maasakkers

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

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