Create carriage-return in Notepad using replace


A

anthonyroh

Can anyone tell me how to create carriage returns in a Notepad
document? Using from the Edit Menu, Replace? for example, for every
comma it detects a carriage return on the comma.
 
G

Graham Mayor

There is no 'carriage' to return in a word processor. Pressing the enter key
(^p in the replace dialog) creates a new paragraph. Shift enter (^l) creates
a new line within a paragraph.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Ad

Advertisements

A

anthonyroh

Hey Graham,
Thanks, I realized I put this into the wrong group. I am trying to
make a script easier to read using Notepad. I know there is a command
out there using the Edit\Replace to substitute commas with a carriage
return to make everything with a comma on a new line.

Sorry if I was confusing, but thanks for responding. Any thoughts
using Notepad?
 
G

Graham Mayor

You'll need to use a more capable text editor, such as Word or maybe
UltraEdit.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Joined
Jun 23, 2009
Messages
1
Reaction score
0
This can be done in Notepad (for CSV files)

You can search and replace by CR in Notepad (works for CSV purposes) by:

- Firing up Excel, and typing Alt-Enter in a cell to enter a CR
- Saving this file as CSV
- Opening this CSV in Notepad - the CR will be shown as a blank square
- Copy this square and paste it into Replace
- When replace is done, CR will be there, and can be interpreted (though not with Notepad - but Wordpad will do it, so will Excel...)

Petar
 
Joined
Oct 27, 2011
Messages
1
Reaction score
0
There are a couple of solutions. This requires a text editor with more features than Notepad, preferably "regular expressions".
1) Get a free download of Notepad++. After pasting your text into a new file window, select Search / Replace from the menu. Put a comma in the "Find what:" box, and the following in the "Replace with:" box: \n

NOTE: You must select the radio button at the bottom left of the replace popup for "Regular expression". The above will execute a regular expression to replace all commas with a carriage return.

2) The same thing can be done with Edit Pad Pro, Ultraedit, etc. Another idea is to view the file in hexadecimal code (Editpad Pro should be able to do this), do a find for the hex value of a comma (2C), and do a "replace all" with the hex value of a carriage return (0D).

Greg Burdett
 
Joined
Jun 15, 2013
Messages
1
Reaction score
3
Can anyone tell me how to create carriage returns in a Notepad
document? Using from the Edit Menu, Replace? for example, for every
comma it detects a carriage return on the comma.
Hey Tony,
You may do the following to get it the way you want.
Replace " , " with " <br> " and then, save as with an " .html " extension.
Open the html file in the browser, You'll get it the way you want. Copy the text from there, and paste it back to the notepad, saving it as a text file. :thumb:
 
Joined
Jul 27, 2015
Messages
1
Reaction score
0
Amazing! An exellent example of KISS (Keep It Simple Stupid). No downloads, no installs ....
just wit! Congrats!
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top