Searching something for automatition
-
Fellow Notepad++ Users,
Could you please help me the the following search-and-replace problem I am having?
DESCRIBE CIRCUMSTANCES OF YOUR QUESTION
Here is the data I currently have (“before” data):
lala.bubu@email.com peter.sillie@email.com hans.klammer@email.comHere is how I would like that data to look (“after” data):
lala.bubu@email.com;peter.sillie@email.com;hans.klammer@email.comTo accomplish this, I have tried using the following Find/Replace expressions and settings
Find What = `.com` Replace With = `.com;` Search Mode = NORMALI am looking for a way (similar to Autoit) to automate certain things in Notepad++. Like a macro recording. Using Notepad++ I could search and replace .com with .com; but then after that I am using the keyboard to hit the end key and then the delete key to make the 2nd line come up to the first line and so on. How can I solve this?
Unfortunately, this did not produce the output I desired, and I’m not sure why. Could you please help me understand what went wrong and help me find the solution?
Thank you.
-
@holger-hasenmüller said in Searching something for automatition:
Like a macro recording. Using Notepad++ I could search and replace .com with .com; but then after that I am using the keyboard to hit the end key and then the delete key to make the 2nd line come up to the first line and so on. How can I solve this?
You are super close to solving your own problem without fancy F&R techniques.
Do at least one simple normal Find of
.comas you already did (to “load” the Find “machinery”). Dismiss the Find dialog and press F3 a few times and observe it working.Now cursor to file home (or to start of first line with an email address).
Start macro recording.
<F3><END>;<Del>
End macro recording.Now run the macro a few times with Ctl-Shift-p to confirm operation is as expected. Then you can run it
Multiple Times...using suitable options for your need.If you’d also like to experience use of a sophisticated F&R technique, take a look at this post. It shows how to join adjacent non-empty lines into single lines using a Regular Expression F&R, which is what you want except that, to meet your need, instead of replacing each newline with nothing, you would replace with
;. -
Hello, @holger-hasenmüller, @neil-schipper and All,
@holger-hasenmüller, a quick solution is possible using the
Regular expressionsearch mode :-
Open the Replace dialog (
Ctrl + H)-
SEARCH
(?-s)@[a-z]+\.[a-z]+\K\R(?=.) -
REPLACE
; -
Tick the
Wrap aroundoption -
Select the
Regular expressionserach mode -
Click, once, on the
Replace Allbutton ( Do not use theReplacebutton ! )
-
-
Hit the
Esckey to close the Replace dialog
So, for instance, from this INPUT text :
Start of text Yeaaaaah ! lala.bubu@email.com peter.sillie@email.com hans.klammer@email.com blah blah bla bla This is a test OK lala.bubu@email.net peter.sillie@email.gov hans.klammer@email.fr End of textyou would get the OUTPUT text below :
Start of text Yeaaaaah ! lala.bubu@email.com;peter.sillie@email.com;hans.klammer@email.com blah blah bla bla This is a test OK lala.bubu@email.net;peter.sillie@email.gov;hans.klammer@email.fr End of textBest Regards,
guy038
-
-
@guy038 said in Searching something for automatition:
guy038
Hi guy038,
that’s pretty cool.
Thank you very much
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