notepad++“\n”字符串轉換行符

Replace "\n" with new line characters, using Notepad++

Posted on July 5, 2011 by giannis

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

notepad-1.PNG

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++.

notepad-2.PNG

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:

replace-1.PNG

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

notepad-3.PNG

I hope this helped!

This entry was posted in Uncategorized. Bookmark the permalink.

← PHP Extensions do not load on fresh WAMP installation

How to go off the record in Gmail when "Go off the record" is grayed →

76 Responses to Replace "\n" with new line characters, using Notepad++

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章