Community
    • Login

    Add Charater to everyline that begins with

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 171 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.
    • Clyde ParkerC
      Clyde Parker
      last edited by

      I’m trying to add + to every line that begins with 31, skips if it’s not in the begining and skips if it already has a +

      Example:

      97898795433131
      +319797831331
      3146464646463
      

      to

      97 89 87 95 31
      +31 97 97 83 31
      +31 46 46 46 31
      

      not

      97 89 87 95 +31
      ++31 97 97 83 +31
      +31 46 46 46 +31
      

      thanks

      1 Reply Last reply Reply Quote 2
      • guy038G
        guy038
        last edited by

        Hello, @clyde-parker and All,

        Not too difficult with regexes !

        SEARCH ^(?=31)

        REPLACE +

        • This regex will search for beginning of current line , so the virtual zero-length location, but ONLY IF  followed with the string 31

        • Then, in replacement, it will simply add the + symbol at the very beginning of current line

        Best regards,

        guy038

        1 Reply Last reply Reply Quote 3
        • Clyde ParkerC
          Clyde Parker
          last edited by

          works pretty good thank you sir!

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