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.
    • Faisal AlamF
      Faisal Alam
      last edited by

      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
      • guy038G
        guy038
        last edited by

        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

        Faisal AlamF 1 Reply Last reply Reply Quote 3
        • Alan KilbornA
          Alan Kilborn
          last edited by

          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
          • Faisal AlamF
            Faisal Alam @guy038
            last edited by Faisal Alam

            @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
            • guy038G
              guy038
              last edited by

              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

              Faisal AlamF 1 Reply Last reply Reply Quote 1
              • Faisal AlamF
                Faisal Alam @guy038
                last edited by

                @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
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors