Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 665 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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

            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