• Login
Community
  • Login

Prefix and suffix a text entry at start of every line

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 5.0k 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.
  • R
    Richard Avon
    last edited by Feb 17, 2018, 8:40 AM

    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.

    C 1 Reply Last reply Feb 17, 2018, 12:44 PM Reply Quote 1
    • C
      Claudia Frank @Richard Avon
      last edited by Feb 17, 2018, 12:44 PM

      @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

      R 1 Reply Last reply Feb 18, 2018, 7:24 PM Reply Quote 0
      • R
        Richard Avon @Claudia Frank
        last edited by Richard Avon Feb 18, 2018, 7:25 PM Feb 18, 2018, 7:24 PM

        @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

        C 1 Reply Last reply Feb 18, 2018, 7:29 PM Reply Quote 1
        • C
          Claudia Frank @Richard Avon
          last edited by Claudia Frank Feb 18, 2018, 7:30 PM Feb 18, 2018, 7:29 PM

          @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

          R 1 Reply Last reply Feb 19, 2018, 1:56 AM Reply Quote 0
          • R
            Richard Avon @Claudia Frank
            last edited by Feb 19, 2018, 1:56 AM

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