Windows上命令行搜索和替换工具的建议

时间:2022-07-17 00:12:54

I am looking for a Windows tool (exe) or Python script which can be used on the command line to search and replace strings in text files recursively in a source code tree. I am trying to avoid the custom syntax of sed/awd like linux tools. It needs to be automated, therefore it needs to be command line.

我正在寻找一个Windows工具(exe)或Python脚本,可以在命令行上使用它来源代码树中递归搜索和替换文本文件中的字符串。我试图避免像Linux工具一样的sed / awd的自定义语法。它需要自动化,因此它需要是命令行。

Any suggestions?

4 个解决方案

#1


I think WinGrep may meet your needs. I believe it can be run from the command line. Link: www.wingrep.com

我认为WinGrep可能会满足您的需求。我相信它可以从命令行运行。链接:www.wingrep.com

#2


A little pricey, but PowerGrep has a command line interface or so the manual says.

有点贵,但PowerGrep有一个命令行界面,或者说手册说。

#3


There is fnr.exe, which is a lightweight utility that supports command line. It doesn't have as many features as grep, but it makes it easy to generate command line script by providing all the parameters in windows form. It is available from here: http://findandreplace.codeplex.com

有fnr.exe,它是一个支持命令行的轻量级实用程序。它没有grep那么多的功能,但它可以通过提供windows窗体中的所有参数来轻松生成命令行脚本。它可以从这里获得:http://findandreplace.codeplex.com

#4


NotePad++ worked great. Free add-in. Search - Find in files...

NotePad ++运行良好。免费加载项。搜索 - 在文件中查找...

#1


I think WinGrep may meet your needs. I believe it can be run from the command line. Link: www.wingrep.com

我认为WinGrep可能会满足您的需求。我相信它可以从命令行运行。链接:www.wingrep.com

#2


A little pricey, but PowerGrep has a command line interface or so the manual says.

有点贵,但PowerGrep有一个命令行界面,或者说手册说。

#3


There is fnr.exe, which is a lightweight utility that supports command line. It doesn't have as many features as grep, but it makes it easy to generate command line script by providing all the parameters in windows form. It is available from here: http://findandreplace.codeplex.com

有fnr.exe,它是一个支持命令行的轻量级实用程序。它没有grep那么多的功能,但它可以通过提供windows窗体中的所有参数来轻松生成命令行脚本。它可以从这里获得:http://findandreplace.codeplex.com

#4


NotePad++ worked great. Free add-in. Search - Find in files...

NotePad ++运行良好。免费加载项。搜索 - 在文件中查找...