Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use backspace escape sequence in Notepad++?

I need to use find new lines (\n) in a .txt file and replace them with a backspace (\b). Using this in the Find and Replace feature of Notepad++ successfully finds the new lines, (\n), but replaces them with the characters "\b" instead of applying a backspace. How can this be done correctly?

like image 720
vergil corleone Avatar asked Oct 12 '13 12:10

vergil corleone


People also ask

How do you add a backspace character in Notepad ++?

Show activity on this post. Go to Edit menu, line operations and then click on "Remove Empty Lines" You get what you are trying with regular expression. Show activity on this post. Use regular expressions, in Find what:, enter \r\n and in Replace with: leave that blank.

How do you backspace in regex?

The meaning of the \b escape sequence inside a regular expression depends on its syntactic context: inside a character class, it matches the backspace character; outside of a character class, it matches a word boundary.


2 Answers

\r\n should work.

replace them with empty field and you will get your backspace(\b) equivalent

like image 81
rtyusolf Avatar answered Sep 17 '22 16:09

rtyusolf


A simple way would be Ctrl + J or Edit->Line Operations->Join Lines

I was also trying to replace \n with backspace, but the above solutions seems neat. Maybe it helps someone.

(I tried the \r\n solution and it seems both works the same way :) )

like image 31
Monster Brain Avatar answered Sep 20 '22 16:09

Monster Brain