1) Using your mouse, highlight a formfeed/carriage return by starting at the end of one line and highlighting to the beginning of the next line.
2) Control-C to copy
3) Control-H to open the Replace dialog box
4) Click in the Find What box
5) Control-V to paste the formfeed/carriage return
6) don't put anything in the Replace With textbox
7) Click on the Replace All button.
note that this is good only for replacing the line breaks, not keeping them and then adding something extra to the beginning of each line
I wish the developers would put a "special char" option on the find/replace boxes just like ultraedit does, for example in the regular find/replace boxes you can put ^p and that means a line break, its realy handy when you want for example to several lines of code at once, i.e.:
for(i=0;i=10;i++)
printf("...");
if (whatever==xx)
I've seen you can manage with notepad++, but that ^p thing is great and easier. I actually switch to ultraedit to do it faster and then copy/paste it (silly, I know, eheh)
cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"I wish the developers would put a "special char" option on the find/replace boxes just like ultraedit does, for example in the regular find/replace boxes you can put ^p and that means a line break, its realy handy when you want for example to several lines of code at once"
If you use the advanced find/replace (control+r) you can use control+m to represent newlines in either the find text or the replace text, if regex is turned off. See http://notepad-plus.wiki.sourceforge.net/FindReplaceNewlineHowTo for more details. It actually displays it as a newline, so it's probably more intuitive to use than something like ^p, but because you can't see them it's possible to make mistakes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nobody said:
>Due to your tip, I used:
>Search for: ^
>Replace with: ^*
>
>This should insert an asterik to the beginning of every line.
>I got an error:
><pre> The regular expression to search is formed badly </pre>
It only does that for me if I use the simple search (^H) and click "replace all". I don't know why. Searching for ^ and replacing with * works if I keep clicking Replace. The simple search only works within one line and can't remove the start of line, so you don't need it in the replacement string.
An advanced search without regexp for ^M and replacing with ^M* will do it for all but the first line and might add an extra at the end.
Hello!
Can I search for paragraph (line break) in Notepad++?
I want to set an asterik (*) to the beginnging of every line, so i wanted to replace a "linebreak" with "linebreak * "
Example:
Before:
Hello World!
I like Notepad++
Its nice
After Replace:
* Hello World!
* I like Notepad++
* Its nice
At this time, I use MS Word to do this ... but I dislike MS-Word-usage to edit plaintext ;)
I found this at http://www.terryscomputertips.com/computers/howto-removing-carriage-returns-from-documents.php
1) Using your mouse, highlight a formfeed/carriage return by starting at the end of one line and highlighting to the beginning of the next line.
2) Control-C to copy
3) Control-H to open the Replace dialog box
4) Click in the Find What box
5) Control-V to paste the formfeed/carriage return
6) don't put anything in the Replace With textbox
7) Click on the Replace All button.
note that this is good only for replacing the line breaks, not keeping them and then adding something extra to the beginning of each line
I wish the developers would put a "special char" option on the find/replace boxes just like ultraedit does, for example in the regular find/replace boxes you can put ^p and that means a line break, its realy handy when you want for example to several lines of code at once, i.e.:
for(i=0;i=10;i++)
printf("...");
if (whatever==xx)
commented out like this
//for(i=0;i=10;i++)
// printf("...");
//if (whatever==xx)
I've seen you can manage with notepad++, but that ^p thing is great and easier. I actually switch to ultraedit to do it faster and then copy/paste it (silly, I know, eheh)
cheers
"I wish the developers would put a "special char" option on the find/replace boxes just like ultraedit does, for example in the regular find/replace boxes you can put ^p and that means a line break, its realy handy when you want for example to several lines of code at once"
If you use the advanced find/replace (control+r) you can use control+m to represent newlines in either the find text or the replace text, if regex is turned off. See http://notepad-plus.wiki.sourceforge.net/FindReplaceNewlineHowTo for more details. It actually displays it as a newline, so it's probably more intuitive to use than something like ^p, but because you can't see them it's possible to make mistakes.
You can search for newline or endline characters.
Newline = ^
Endline = $
Note you must be have the Regular Expression check box selected when you use the special characters.
However, I have another reason for answering this thread.
I want to know if you can replace a searched value with a line feed.
I want to search for the expression;
$End-Procedure
and I want to replace it with;
Do Routine_Name()
End-Procedure
I cannot figure out how to incorporate a newline feed character into my replace expression.
Regards,
Tom
Ah, here it is...
http://notepad-plus.sourceforge.net/uk/newlineFindReplace-HOWTO.php
Regards,
Tom
Thanks for the reply.
Due to your tip, I used:
Search for: ^
Replace with: ^*
This should insert an asterik to the beginning of every line.
I got an error:
<pre> The regular expression to search is formed badly </pre>
Whats wrong?
Nobody said:
>Due to your tip, I used:
>Search for: ^
>Replace with: ^*
>
>This should insert an asterik to the beginning of every line.
>I got an error:
><pre> The regular expression to search is formed badly </pre>
It only does that for me if I use the simple search (^H) and click "replace all". I don't know why. Searching for ^ and replacing with * works if I keep clicking Replace. The simple search only works within one line and can't remove the start of line, so you don't need it in the replacement string.
An advanced search without regexp for ^M and replacing with ^M* will do it for all but the first line and might add an extra at the end.
This stuff is a bit of a mess in Notepad++. http://notepad-plus.sourceforge.net/uk/newlineFindReplace-HOWTO.php explains everything I've discovered about it.