Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Prefix and suffix a text entry at start of every line

    Help wanted · · · – – – · · ·
    2
    5
    2880
    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 Avon
      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 Frank 1 Reply Last reply Reply Quote 1
      • Claudia Frank
        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 Avon 1 Reply Last reply Reply Quote 0
        • Richard Avon
          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 Frank 1 Reply Last reply Reply Quote 1
          • Claudia Frank
            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 Avon 1 Reply Last reply Reply Quote 0
            • Richard Avon
              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
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors