Community
    • Login

    Remove Spaces if match with keywords

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    10 Posts 2 Posters 1.1k Views 2 Watching
    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.
    • Rajesh TR Offline
      Rajesh T
      last edited by

      Hi Team,

      Need your help to remove spaces based on keywords matching;

      Example:
      CAG000099 1ORCOMM
      CAG000099 1ORCOMM
      CAG000099 2ORCOMB
      CAG000099 3COMM
      CAG000099 1COMB

      If the above rows match with keyword COM,reduce the spaces(Currency 3spaces,i want only 1 space) in between above two words.

      Expected:
      CAG000099 1ORCOMM(3 Spaces)
      CAG000099 1ORCOMM(1 Space)

      Thank you in advance.

      1 Reply Last reply Reply Quote 0
      • rinku singhR Offline
        rinku singh
        last edited by

        here is no Currency symbol instead
        hi rajesh you can speak hindi

        1 Reply Last reply Reply Quote 0
        • rinku singhR Offline
          rinku singh
          last edited by

          @Rajesh-T said in Remove Spaces if match with keywords:

          between above two words.

          find 3 spaces in your name using rexex
          find what : Rajesh\s\s\sT

          1 Reply Last reply Reply Quote 0
          • Rajesh TR Offline
            Rajesh T
            last edited by

            Hi @gurikbal-singh ,

            No ,only english…Its currently typo mistake.

            I have 3 spaces in between CAG000099 and 1ORCOMM,
            Requied only 1 space between CAG000099 and 1ORCOMM,

            1 Reply Last reply Reply Quote 0
            • rinku singhR Offline
              rinku singh
              last edited by rinku singh

              @Rajesh-T said in Remove Spaces if match with keywords:

              CAG000099 and 1ORCOMM

              find what :CAG000099\s\s\s1ORCOMM
              replace with :CAG000099\s1ORCOMM

              using regex

              1 Reply Last reply Reply Quote 0
              • Rajesh TR Offline
                Rajesh T
                last edited by

                hi @gurikbal-singh

                1ORCOMM can be change in few lines,either it will be 1 COMM or 2 COMM or 2ORCOMM but COM is common in all keywords.
                How we handle in this case?

                1 Reply Last reply Reply Quote 0
                • rinku singhR Offline
                  rinku singh
                  last edited by rinku singh

                  @gurikbal-singh said in Remove Spaces if match with keywords:

                  where in example every line starts with CAG000099

                  find what :^CAG000099\s\s\s
                  replace with :^CAG000099\s

                  1 Reply Last reply Reply Quote 0
                  • Rajesh TR Offline
                    Rajesh T
                    last edited by

                    hi @gurikbal-singh

                    Its exactly looks like below

                    AG00001FF363611113636111010103G16CAF000011 1ORCOMM

                    AG00286FF004409580044095010100C17AAF002800 2COMB
                    AG00286FF004372480043724010100C17AAF002800 2COMVC2

                    1 Reply Last reply Reply Quote 0
                    • rinku singhR Offline
                      rinku singh
                      last edited by

                      replace \s\s\s with \s

                      1 Reply Last reply Reply Quote 0
                      • Rajesh TR Offline
                        Rajesh T
                        last edited by

                        Thank you @gurikbal-singh .
                        The information you provided matches few conditions.

                        1 Reply Last reply Reply Quote 0

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