Community
    • Login

    How to mark lines with the first 10 characters duplicated

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    15 Posts 3 Posters 3.7k 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.
    • EkopalypseE
      Ekopalypse
      last edited by

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

      I assume that the first 10 characters are always digits and can be any combination?

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

        @Ekopalypse
        Can be any combination

        EkopalypseE 1 Reply Last reply Reply Quote 0
        • EkopalypseE
          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
            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
              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
                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
                  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
                    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
                      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
                        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
                          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
                            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
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors