How to separate words of specific strings?
-
Let’s not waste any time and try to comprehend through the example given.
What I have:
6545 BRANDYWINI DR.SO KLAMATH FALLS CA
What I want:
6545 BRANDYWINI DR.SO KLAMATH FALLS CA
Note: The word i want to seperate always consist ONLY 2 STRINGS/DIGITS/CHARACTERS and are always in uppercase
Thank you.
-
Hi, @faisal-alam and All,
Unlike your other post , the description of what you needs isn’t accurate enough !
You said :
Note: The word i want to seperate always consist ONLY 2 STRINGS/DIGITS/CHARACTERS and are always in uppercase
But, in the line :
6545 BRANDYWINI DR.SO KLAMATH FALLS CA
There are three words containing two uppercase letters :
-
DR
-
SO
-
CA
Or do you mean : I want the last word of line, with two uppercase letters, to be moved on next line ?
Regards,
guy038
-
-
Do we just keep answering this person’s trivial data manipulations forever? Or do we request that said person start learning so that we can pursue more interesting things on this forum?
-
@guy038 i can manage everything if we are going for the last words but you need to tell me that doing this operation won’t affect the other 2 string words in any other line(case insensitive) and Thanks of course bro
-
Hello, @faisal-alam and All,
OK… So, the following regex S/R :
SEARCH
\x20(\w\w(\R))
REPLACE
\2\1
should do the trick !
Notes :
-
This search regex looks for a space character
\x20
followed with any word of two word characters\w\w
( digits, uppercase or lowercase letters or the underscore char ) and followed with line-break character(s)(\R)
-
The word with the immediate line-break is stored as group
1
-
The line-break, itself, is stored as group
2
-
In replacement, we first add a line break
\2
then the two-word chars and its line -break, so\1
But, sincerely, as @alan-kilborn said, you’d better learn from specific regex sites, to have a complete oversight of the regex world ! Refer, to these links below :
https://ryanstutorials.net/regular-expressions-tutorial/
https://ryanstutorials.net/regular-expressions-tutorial/regular-expressions-basics.php
https://www.regular-expressions.info/quickstart.html
http://www.regular-expressions.info
Looks also to this FAQ for other links :
https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation
Of course, we are ready to help you if you have problems with a particular passage of these training courses !
Regards,
guy038
-
-
@guy038 thank you so much from my deep heart. I really appreciate your efforts towards an stranger like me. And i will definitely try learning from links provided by you. Thanks again.