Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to mark lines with the first 10 characters duplicated

    Help wanted · · · – – – · · ·
    3
    15
    80
    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 Osorio
      Jose Emilio Osorio last edited by

      Good Afternoon. How to mark lines with the just first 10 characters duplicated

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

        @Jose-Emilio-Osorio

        Sorry, but is not understandable to me. Can you provide an example?

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

          @Ekopalypse
          1234567890;Example1;100
          1234 ;Example2;200
          1233334554;Example3;300
          1234567890;Example7;700
          I need to mark the line 1 and 4.

          1 Reply Last reply Reply Quote 1
          • Ekopalypse
            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 Osorio 1 Reply Last reply Reply Quote 0
            • Jose Emilio Osorio
              Jose Emilio Osorio @Ekopalypse last edited by

              @Ekopalypse
              Can be any combination

              Ekopalypse 1 Reply Last reply Reply Quote 0
              • Ekopalypse
                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 Osorio 1 Reply Last reply Reply Quote 0
                • Jose Emilio Osorio
                  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

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

                    @Jose-Emilio-Osorio

                    what about this?

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

                    Checking regular expression.

                    Jose Emilio Osorio 1 Reply Last reply Reply Quote 0
                    • Jose Emilio Osorio
                      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
                      • Ekopalypse
                        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 Osorio 1 Reply Last reply Reply Quote 0
                        • Jose Emilio Osorio
                          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 Osorio 1 Reply Last reply Reply Quote 1
                          • Jose Emilio Osorio
                            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 Kilborn Ekopalypse 2 Replies Last reply Reply Quote 0
                            • Alan Kilborn
                              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?

                              Ekopalypse 1 Reply Last reply Reply Quote 0
                              • Ekopalypse
                                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
                                • Ekopalypse
                                  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
                                  Copyright © 2014 NodeBB Forums | Contributors