|
Consider the scenario where you have a specific string that you want to find-and-replace. You want to replace it with a new string that contains a newline command.
In the scenario above, I’d like to find “ The results would look like:
Question: How would you most easily achieve this using Notepad++. Are there any other tools that you’d suggest to easily perform this command?
|
||||
|
feedback
|
|
Notepad++ will do just fine. search string : xyz456 (note the space in front of xyz456) replace string : \r\nxyz456 “\r\n” is the code for carriage-return in Notepad++. |
|||||||||||||
feedback
|
|
In Notepad++, it’s very easy…
The trick is to set the search mode. |
|||||||
feedback
|
|
In the “Replace” dialog, make sure that under Search Mode you have “Extended” selected. Then type in the find box enter “xyz” and replace with “\n”. |
|||
|
feedback
|
|
I cheat a bit when S&Ring characters that I can’t type directly into the text fields (e.g. tabs and newlines). Find somewhere in the document which already has that character, then copy it, and paste it into the replace field. So in your example, start at the very start of one line, click, drag to the very end of the preceeding line, copy that, and paste it into the Replace dialog. |
|||||
feedback
|
|
For Notepad++, change the search mode to Extended then in the Replace with field use \n. |
|||
|
feedback
|

Recent Comments