• Login
Community
  • Login

How to separate words of specific strings?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 3 Posters 1.5k 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.
  • F
    Faisal Alam
    last edited by Dec 25, 2020, 1:45 AM

    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.

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by Dec 25, 2020, 12:09 PM

      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

      F 1 Reply Last reply Dec 25, 2020, 1:27 PM Reply Quote 3
      • A
        Alan Kilborn
        last edited by Dec 25, 2020, 12:41 PM

        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?

        1 Reply Last reply Reply Quote -1
        • F
          Faisal Alam @guy038
          last edited by Faisal Alam Dec 25, 2020, 1:28 PM Dec 25, 2020, 1:27 PM

          @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

          1 Reply Last reply Reply Quote 0
          • G
            guy038
            last edited by Dec 25, 2020, 2:24 PM

            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

            F 1 Reply Last reply Dec 25, 2020, 2:28 PM Reply Quote 1
            • F
              Faisal Alam @guy038
              last edited by Dec 25, 2020, 2:28 PM

              @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.

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