使用Notepad++将字符\n替换为回车换行

In case you have a file which contains "escaped" new lines (\n), like this:



and you want to replace the escaped new line sequences with actual new line characters, you can easily accomplish this task using  Notepad++ .

First load your file (or just copy paste the text) in Notepad++.



Then select Search → Replace from the menu, or hit Ctrl-H. The Replace dialog will show up. Therein make sure that you fill out the following values;  Find what:   \\n  (yes,  two  back-slashes),  Replace with:   \n (yes, just one back-slash), and the most important, make sure you select the  Extended (\n, \r, \t, \0, \x, ...)  radio button. Your Replace dialog must look like this:



Click the Replace All button, and all escaped new line sequences will be replaced with new line characters:



I hope this helped!

转载自:http://www.giannistsakiris.com/index.php/2011/07/05/replace-n-with-new-line-characters-using-notepad/



你可能感兴趣的:(杂谈)