Community
    • Login

    Prefix and suffix a text entry at start of every line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 5.6k 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.
    • Richard AvonR Offline
      Richard Avon
      last edited by

      Hello
      Enjoy Notepad++. Much appreciated.

      I’m stumped. Needing to change following, for egs.
      1 xxx zzz
      2 aaa ddd
      To
      (1) xxx zzz
      (2) aaa ddd

      Similarly same for last entry of every line.

      I have Googled to no avail.
      Really appreciate help thank you.

      Claudia FrankC 1 Reply Last reply Reply Quote 1
      • Claudia FrankC Offline
        Claudia Frank @Richard Avon
        last edited by

        @Richard-Avon

        from your provided data I would assume that you are looking for

         find what:^\d
         replace with:\($0\)
        

        with regular expression checked.
        But it might be that the find what needs to be modified if two or more digits form a number,
        but I can’t say for sure as I don’t know how your data really looks like.

        Cheers
        Claudia

        Richard AvonR 1 Reply Last reply Reply Quote 0
        • Richard AvonR Offline
          Richard Avon @Claudia Frank
          last edited by Richard Avon

          @Claudia-Frank
          Thanks Claudia
          I’ll try this when get back to office later today.
          My data is a bit more complex than shown above.
          Typically
          100 12°15’34" 12.562 o’stones
          101 35°38’56" 17.765 p&r fence
          102 84°40’10“ 25.456 bricks

          And so on in similar fashion
          The numbers (point numbers) at beginning of each line maybe any numeral from 1 to say 1000, and random.

          Regards

          Claudia FrankC 1 Reply Last reply Reply Quote 1
          • Claudia FrankC Offline
            Claudia Frank @Richard Avon
            last edited by Claudia Frank

            @Richard-Avon

            then replace “find with” with this one

             ^\d+
            

            ^ marks that it is the start of the line
            \d it must be a digit
            and the plus sign at the end tells that it must be at least 1 digit,
            without the plus sign it is looking for exactly one digit.

            Replace with is still the same.

            Cheers
            Claudia

            Richard AvonR 1 Reply Last reply Reply Quote 0
            • Richard AvonR Offline
              Richard Avon @Claudia Frank
              last edited by

              @Claudia-Frank
              Many thanks Claudia. Brilliant.
              Thanks for taking the time to explain this.
              In much appreciation
              Regards
              Richard

              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