find at and copy text to the end of a different line
-
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 Candesired results must be in line 4
line 4 - Name Catch me If You Can
line 6 - Slogan If You Canthanks
Mabura
-
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.
-
@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
-
So, before text is:
line 1 line 2 line 3 Name Catch me line 5 Slogan If You Can line 7and after text is:
line 1 line 2 line 3 Name Catch me If You Can line 5 Slogan If You Can line 7You could do:
Find:
\A(?-is)(?:.*\R){3}.*\K(?=\R(?:.*\RSlogan(.+)))
Replace:${1}
Search mode: Regular expressionOther solutions are definitely possible.
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