Community
    • Login

    find at and copy text to the end of a different line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 345 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.
    • Sibusiso DlomoS
      Sibusiso Dlomo
      last edited by

      Hi

      I am new here, can someone tell me if is there a way to copy the text on multiple documents of the same structure and past it at the end of a specific line.

      e.g. line 4 - Name Catch me
      line 6 - Slogan If You Can

      desired results must be in line 4
      line 4 - Name Catch me If You Can
      line 6 - Slogan If You Can

      thanks

      Mabura

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Sibusiso Dlomo
        last edited by

        @Sibusiso-Dlomo

        You need to state a more rigid pattern than that, for any sane person to even start offering help.

        For example, if you’d said “I need to take the last 3 words on line 6 and copy them to the end of line 4 after adding a space…” then that is a more solid starting point. Of course, that can be a starting point, if it is true, but until you confirm it we have no real reason to assume that is a rigid definition of what you want.

        Sibusiso DlomoS 1 Reply Last reply Reply Quote 0
        • Sibusiso DlomoS
          Sibusiso Dlomo @Alan Kilborn
          last edited by

          @Alan-Kilborn thank you for the quick reply.

          Yes, I want to copy all text on line 6 after the word Slogan and paste them at the end of line 4.

          Thanks

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @Sibusiso Dlomo
            last edited by

            @Sibusiso-Dlomo

            So, before text is:

            line 1
            line 2
            line 3
            Name Catch me
            line 5
            Slogan If You Can
            line 7
            

            and after text is:

            line 1
            line 2
            line 3
            Name Catch me If You Can
            line 5
            Slogan If You Can
            line 7
            

            You could do:

            Find: \A(?-is)(?:.*\R){3}.*\K(?=\R(?:.*\RSlogan(.+)))
            Replace: ${1}
            Search mode: Regular expression

            Other solutions are definitely possible.

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