Community
    • 登入

    Eliminate duplicate rows / show unique rows (only)

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    4 貼文 3 Posters 35.6k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Jim BiwerJ
      Jim Biwer
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • dailD
        dail
        最後由 編輯

        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 條回覆 最後回覆 回覆 引用 0
        • greenzestG
          greenzest
          最後由 編輯

          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 條回覆 最後回覆 回覆 引用 0
          • Jim BiwerJ
            Jim Biwer
            最後由 編輯

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

            1 條回覆 最後回覆 回覆 引用 0
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors