Normally I'd do a search and replace for "\n" but that doesn't seem to work.
I think it might by ^(something) but can't remember what.
Note this is question is directed at Notepad, not Notepad++. Bad Bing and Google, no biscuit!
While you might just want to upgrade to a better text editor or use the Command trick mentioned by txtechhelp, but I can understand if you are looking for a simple find and replace solution instead of going toward the complicated solutions.
One such trick is to replace "your character" with <br>
and saving the file as .html.
Opening the html file in any browser will give you the text or csv data but with new lines added.
This way you do not need any additional software or even a line of code.
Hope that helps.
In Notepad: select from the end of a line (clicking SHIFT + Right arrow key; you can't see it, but the newline character is now selected). Now, go to "Replace" and replace with nothing. The newline characters will all be replaced with nothing.
There's not a direct way in Notepad itself, but if you don't want to use an external program and you're comfortable with the command line you could do something like the following:
type FILE_NAME | more /P > TEMP_FILE_NAME && move /Y TEMP_FILE_NAME FILE_NAME
This will output the file to the more
command, and with the /P
will expand form feed characters (i.e. change \n
to \r\n
) and save it to the temp file you specify .. the move /Y
just automates it a little more to overwrite the old file with the \n
endings with the new file with the \r\n
endings.
Hope that helps.
Use Notepad2. It is literally the first thing I do after installing any version of Windows. Always.
Florian (the creator) has an installer that will replace the normal Notepad.exe application that ships with Windows (admin/elevation required to install it, not needed to run it). After using the installer, Notepad2 will run instead, whenever 'notepad.exe' is run.
You can also download a normal installer (installs to where ever you choose) where elevation is not required to install it, as well as the source code, etc.
Using Notepad2 for the search and replace is super simple. In the Replace text dialog, check the 'Translate backslashes' option. Then you can use \r\n
, \n
, \t
, etc., in the Search and/or Replace text fields.
Open find or replace & Notepad will copy & paste highlighted text, including newlines, into the find box automatically. Trying to copy & paste text into the 'replace with' box that includes a newline box sometimes works. Might depend if save was done after replaceing with a newline. This seems inconsistent.
^l
or^p
but I couldn't get it to work in my tests.