Community
    • Login

    removing duplicate lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 6.1k 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.
    • Robert MundkowskyR
      Robert Mundkowsky
      last edited by

      Can someone add “remove duplicate lines” as a menu option function?

      TextFX plugin used to do this, but it seems was not updated to support 64 bit version of Notepad++.

      Also I see a lot of answers saying go use regular expressions, but this is a very common operation I have used a lot and it is huge pain to go figure out a valid regular expression for this every time.

      Seems like this has been requested more than once by others as well.

      Hopefully thanks in advance.

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Robert Mundkowsky
        last edited by

        @Robert-Mundkowsky

        What I’ve done is to record a macro for the regular expression search and replace for this. That gets rid of the “huge pain” to dig up the regular expression each time. Perhaps you will find value in doing the same. It may never become a built-in command; the developers don’t seem to build in functionality that can be accomplished in other ways (regex search and replace, plug-in, etc).

        1 Reply Last reply Reply Quote 0
        • guy038G
          guy038
          last edited by guy038

          Hello, Robert Mundkowsky and Scott,

          @scott-sumner

          Nevertheless, the Notepad2 editor, for instance, has features for keeping only unique or multiple lines, while doing sort !!

          ( Select some text, in Notepad2 and hit the ALT + O shorcut to open the sort dialog )


          @robert-mundkowsky

          Here are, below, two useful links, on how to realize such operations, with the help of the N++ regex and sort features :

          https://notepad-plus-plus.org/community/topic/12490/i-want-to-keep-only-unique-lines/2

          https://notepad-plus-plus.org/community/topic/12569/delete-duplicate-lines/7


          • The first one gives you two solutions ( WITH or WITHOUT change of the file’s content’s ) to ONLY keep :

            • All the unique lines

            • All the duplicate lines

            • The first item of all the duplicate lines

          • The second one gives you a method ( WITHOUT change of the natural order of the file’s contents ) to ONLY keep :

            • All the unique lines AND the last item of all the duplicate lines,

          I’m, still, studying these questions, presently ! I’ll, also, try to see if these operations could be easily inserted in macros !

          So, see you later, for some updates :-))

          Best Regards,

          guy038

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