Add a character ) to the end of every lines in Notepad++

39,882

Solution 1

Use $ to match end of line in regular expression mode. Replace with \(, slash is to escape

enter image description here

Solution 2

You need to match extended or regular expression and replace "\n" with ")\n". At least this worked by me so far. According to this there can be differences though Difference between CR LF, LF and CR line break types?

Share:
39,882
Ronaldinho Learn Coding
Author by

Ronaldinho Learn Coding

Updated on October 07, 2020

Comments

  • Ronaldinho Learn Coding
    Ronaldinho Learn Coding over 3 years

    I'd like to add the ) character (close bracket) to the end of all lines.

    I see CR is the end symbol of every lines. (Menu > View > Show Symbol > Show end of line)

    I tried to replace \r with )\r in Regular expression mode but it didn't work.

    How do I do this?

  • inf3rno
    inf3rno over 8 years
    @RonaldinhoLearnCoding can you check whether \n works in your case? just for curiosity...
  • Ronaldinho Learn Coding
    Ronaldinho Learn Coding over 8 years
    this works too along with replace \r with )\r in extended mode
  • Ronaldinho Learn Coding
    Ronaldinho Learn Coding over 8 years
    No, replacing \n with )\n does not work in my case in both extended or regular expression mode because my end line symbol is CR, I need \r
  • inf3rno
    inf3rno over 8 years
    @RonaldinhoLearnCoding Thanks!