• Login
Community
  • Login

How to put marked lines in parenthesis?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 1.7k 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.
  • M
    Marco Torskyj
    last edited by Mar 15, 2017, 5:40 PM

    Hi,
    how can i put marked lines in parenthesis?

    For example:

    1: kjhdfgjhgjfkdjhg dsfkjhg sdkjh gf
    2: kfjgljjfgkf flf gli f fsljh f
    3: khfkjhkjhsdkjhfjfkjhf fjfj wer erwer
    4: nmdfss sjh ewr s dfjh f skjh f

    now I select (mark) line 2 and 3 and the solution should look like this:

    1: kjhdfgjhgjfkdjhg dsfkjhg sdkjh gf
    (2: kfjgljjfgkf flf gli f fsljh f)
    (3: khfkjhkjhsdkjhfjfkjhf fjfj wer erwer)
    4: nmdfss sjh ewr s dfjh f skjh f

    how can I achieve that? :)

    C 1 Reply Last reply Mar 16, 2017, 1:47 PM Reply Quote 0
    • C
      Claudia Frank @Marco Torskyj
      last edited by Mar 16, 2017, 1:47 PM

      @Marco-Torskyj

      if this is a one time job use find and replace dialog with regular expression
      and in selection checked. If you need to do this over and over again, record
      a macro and save it. I will describe the steps for the macro as it contains the step
      for find/replace as well.

      1. Select the lines you want to modify

      2. press record macro

      3. press ctrl+h (to open the replace dialog)

      4. put the following into the find inputbox

          ^(.*)$
        
      5. put the following into the replace inputbox

          \(\1\)
        
      6. check box in selection

      7. check box Regular expression

      8. press replace all

      9. press save macro
        and give it a meaningful name.
        It appears now under the macro menu

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • M
        Marco Torskyj
        last edited by Mar 17, 2017, 1:28 PM

        Thank you very much!!!
        ;)

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