Community
    • Login

    How to mark lines with the first 10 characters duplicated

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    15 Posts 3 Posters 4.8k 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.
    • Jose Emilio OsorioJ Offline
      Jose Emilio Osorio @Ekopalypse
      last edited by

      @Ekopalypse
      Can be any combination

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE Offline
        Ekopalypse @Jose Emilio Osorio
        last edited by

        @Jose-Emilio-Osorio

        Is it important that we keep the lines as it is or can we sort the document first?

        Jose Emilio OsorioJ 1 Reply Last reply Reply Quote 0
        • Jose Emilio OsorioJ Offline
          Jose Emilio Osorio @Ekopalypse
          last edited by

          @Ekopalypse
          The document is sorted by the first 10 characters.
          I want to mark the lines first to check them, and then delete

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE Offline
            Ekopalypse @Jose Emilio Osorio
            last edited by

            @Jose-Emilio-Osorio

            what about this?

            find:(.{10}).*\R\1

            Checking regular expression.

            Jose Emilio OsorioJ 1 Reply Last reply Reply Quote 0
            • Jose Emilio OsorioJ Offline
              Jose Emilio Osorio @Ekopalypse
              last edited by

              @Ekopalypse said in How to mark lines with the first 10 characters duplicated:

              (.{10}).*\R\1

              Thank you very much. It works.
              Last question: How could I delete the line duplicated ? For example just the line 4

              1 Reply Last reply Reply Quote 0
              • EkopalypseE Offline
                Ekopalypse
                last edited by

                @Jose-Emilio-Osorio

                if it is not important which line gets deleted we could use

                find what:(.{10}).*\R(?=\1)
                replace with is empty

                Jose Emilio OsorioJ 1 Reply Last reply Reply Quote 0
                • Jose Emilio OsorioJ Offline
                  Jose Emilio Osorio @Ekopalypse
                  last edited by

                  @Ekopalypse said in How to mark lines with the first 10 characters duplicated:

                  (.{10}).*\R(?=\1)

                  Thank you very much.

                  Jose Emilio OsorioJ 1 Reply Last reply Reply Quote 1
                  • Jose Emilio OsorioJ Offline
                    Jose Emilio Osorio @Jose Emilio Osorio
                    last edited by

                    @Jose-Emilio-Osorio
                    If there are more two lines duplicated, can I use this regex ?

                    Alan KilbornA EkopalypseE 2 Replies Last reply Reply Quote 0
                    • Alan KilbornA Offline
                      Alan Kilborn @Jose Emilio Osorio
                      last edited by

                      @Jose-Emilio-Osorio

                      1234567890;Example1;100

                      1234 ;Example2;200

                      1233334554;Example3;300

                      1234567890;Example7;700

                      I need to mark the line 1 and 4.

                      The document is sorted by the first 10 characters.

                      Hmmm, not seeing the document as being sorted… what am I missing?

                      EkopalypseE 1 Reply Last reply Reply Quote 0
                      • EkopalypseE Offline
                        Ekopalypse @Jose Emilio Osorio
                        last edited by

                        @Jose-Emilio-Osorio said in How to mark lines with the first 10 characters duplicated:

                        If there are more two lines duplicated, can I use this regex ?

                        Yes, I guess so.

                        1 Reply Last reply Reply Quote 0
                        • EkopalypseE Offline
                          Ekopalypse @Alan Kilborn
                          last edited by

                          @Alan-Kilborn

                          maybe just a copy/paste before the sorting took place.

                          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