如何多行“在文件中替换...” 在记事本中++

发布于 2024-07-11 06:05:59 字数 380 浏览 11 评论 0原文

如果免费源代码编辑器 Notepad++ 具有“在文件中查找...”功能”,即没有在编辑器中打开文件,它是否还具有“在文件中替换...”功能?

Notepad++ 基于编辑组件 Scintilla - 在 SourceForge 上对此功能的请求有一个响应: “无需将此命令包含在 SciTE 中,因为您可以使用“参数”对话框将此命令添加到“工具”菜单中。” 那么Notepad++中是否可以进行文件中的多行替换

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

Notepad++ is based on the editing component Scintilla - for which at SourceForge there is a response to a request for this feature: "No need for this to be included in SciTE as you can add this command to the Tools menu using the Parameters dialog." So is it possible to do multi-line replace in files in Notepad++?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

挽手叙旧 2024-07-18 06:05:59

在 Notepad++ 中进行多行替换很容易。 您必须使用 \n 来表示字符串中的换行符,它适用于搜索和替换字符串。 您必须确保选择搜索窗口左下角的“扩展”搜索模式。

我在这里找到了一篇描述这些功能的好文章:
http://markantoniou.blogspot.com/2008 /06/notepad-how-to-use-regular-expressions.html

It's easy to do multiline replace in Notepad++. You have to use \n to represent the newline in your string, and it works for both search and replace strings. You have to make sure to select "Extended" search mode in the bottom left corner of the search window.

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

孤君无依 2024-07-18 06:05:59

实际上,使用 Notepad++ 的 ToolBucket 插件来进行多行替换要容易得多。

要激活它,只需进入 N++ 菜单:

Plugins > 插件管理器> 显示插件管理器> 检查工具桶> 安装。

重新启动 N++ 并按 ALT + SHIFT + F 进行多行编辑。

Actually it's way easier to use ToolBucket plugin for Notepad++ to multiline replace.

To activate it just go to N++ menu:

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

Restart N++ and press ALT + SHIFT + F to multiline edit.

时光是把杀猪刀 2024-07-18 06:05:59

解决方法是

  1. 搜索 \r\n 并将其替换为 thisismynewlineword

(这将删除所有新行,并且应该有一整行)

  1. 现在执行替换

  2. 搜索并替换 thisismynewlineword \r\n

(以撤消步骤 1)

The workaround is

  1. search and replace \r\n to thisismynewlineword

(this will remove all the new lines and there should be whole one line)

  1. now perform your replacements

  2. search and replace thisismynewlineword to \r\n

(to undo the step 1)

一袭白衣梦中忆 2024-07-18 06:05:59

Notepad++ 仍在运行,因此您也可以从菜单插件 -> 安装插件 ToolBucket 插件管理器。 它没有改进本机 Notepad++ 的“搜索和替换”对话框,而是使用自己的快捷键 Alt+Shift+F

< img src="https://i.sstatic.net/OwfBr.png" alt="在此处输入图像描述">

Notepad++ is still up and going so also you can install plugin ToolBucket from menu Plugins -> Plugin Manager. It doesn't improve native Notepad++'s Search and Replace dialog but uses its own with shortcut keys Alt+Shift+F

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文