How to multiline "Replace in files ..." in Notepad ++

If the editor of the free Notepad ++ source code has the function "Find in files ...", that is, without files opened in the editor, does it also have the function "Replace in files ..."?

Notepad ++ is based on the Scintilla editing component - for which SourceForge has a response to a request for this function: "It is not necessary that this be included in SciTE, since you can add this command to the Tools menu using the Options dialog. " So is it possible to make multi-line file replacement in Notepad ++?

+43
notepad ++ scintilla
Jan 01 '09 at 11:23
source share
4 answers

It is easy to make multi-line replacements in Notepad ++. You should use \n to represent a newline in your string, and it works for both search strings and replacements. You must select the "Advanced" search mode in the lower left corner of the search box.

I found a good article describing the functions here: http://markantoniou.blogspot.com/2008/06/notepad-how-to-use-regular-expressions.html

+58
Nov 01 '10 at 18:35
source share

Actually, it's easier to use the ToolBucket plugin for Notepad ++ for multi-line replacements.

To activate it, just go to the N ++ menu:

Plugins> Connection Manager> Show Plugin Manager> Check ToolBucket> Install.

Restart N ++ and press ALT + SHIFT + F for multi-line editing.

+31
Aug 31 '15 at 16:15
source share

Workaround

  • search and replace \ r \ n for thisismynewlineword

(this will delete all new lines and there should be a whole line)

  • now do your replacements

  • find and replace thisismynewlineword with \ r \ n

(to cancel step 1)

+7
Dec 17 '10 at 17:16
source share

This is a subjective opinion, but I think that a text editor does not have to do everything, but a kitchen sink. I prefer lightweight flexible and powerful (in their specialized fields) editors. Although I'm mainly a Windows user, I like the Unix philosophy, which has a lot of specialized tools that you can combine (like UnxUtils ), rather than a monster that does everything, but not necessarily, as you would like!

A file search is on the border of these additional functions, but it is useful when you can double-click the found line to open the file on the right line. Note that initially in SciTE it was just a call to Tools for grep or the equivalent!
FTP is very close to the topic, although it can be seen as an advanced open / save dialog.
Replacing too many IMOs in files: this is dangerous (you can mess many files at once) if you do not have a preview, etc. I would prefer to use the specialized tool that I selected, perhaps among those found in the Find and Replace Multiple String Tool .

To answer the question, looking at N ++, I see the Run menu in which you can run any tool with a name and keyboard shortcut. I also see> NppExec plugins, which seem to be able to run things like sed (haven't tried).

+1
Jan 01 '09 at 12:52
source share



All Articles