Community
    • Login

    Eliminate duplicate rows / show unique rows (only)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 35.9k 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.
    • Jim BiwerJ Offline
      Jim Biwer
      last edited by

      Is there a build in function that will eliminate duplicate rows automatically?
      It should have to sort that data, then eliminate duplicate rows.

      Example, given:
      aaa
      zzz
      bbb
      zzz
      ccc
      jjj
      jjj

      Return the following:
      aaa
      bbb
      ccc
      jjj
      zzz

      Thank you!

      1 Reply Last reply Reply Quote 0
      • dailD Offline
        dail
        last edited by

        Select all the data, do Edit > Line Operations > Sort Lines Lexicographically Ascending (or sort it by some other method in the menu). Then do a find replace in regex mode with:

        Search: ^(.+?)\R(\1\R?)+
        Replace: \1\r\n

        This assumes you are using Windows line endings. Also I believe it is possible to record all this as a macro so then you’d be able to do it with a simple menu command or shortcut.

        1 Reply Last reply Reply Quote 0
        • greenzestG Offline
          greenzest
          last edited by

          Hi,

          An easier way is to install the “TextFX Characters” plugin through the plugin manager; then Plugins > TextFx > TextFx Tools check the options : Sort ascending and Sort outputs only UNIQUE, click on Plugins > TextFx > TextFx Tools > Sort lines case insensitive et voilà :)

          The options are saved so you will only need to click the sort lines next time

          1 Reply Last reply Reply Quote 0
          • Jim BiwerJ Offline
            Jim Biwer
            last edited by

            Thank you! I tried the TestFX option, it worked great. Thanks again!

            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