有时我们需要在多个文件中查找和替换文本。当我们在打开每个文件后尝试这样做时,问题就开始了。当然,您只需几秒钟即可查找和替换两个或三个文件中的文本。然而,想象一下你有五十个文件,你需要在每个文件中查找和替换三个单词。你怎么处理?不要恐慌。这是一个用于Windows(Windows)的简单免费工具,称为查找和替换工具(Find and Replace Tool)。这款便携式软件可以在瞬间查找和替换多个文件中的文本。
(Find)在多个文件中(Multiple Files)查找和替换文本(Replace Text)
首先,下载查找(Find)和替换工具(Replace Tool)并打开它。由于这是便携式软件,您不必安装它。打开Find and Replace Tool后,会出现以下画面,
用户界面整洁。因此,您将很快了解每个选项。但是,只需按照以下步骤使用此免费工具查找和替换多个文件中的文本。
首先,您需要选择所有原始文件所在的目录。(Directory)它将替换放置在一个文件夹中的那些文件中的文本。
因此,要选择目录,只需单击空框旁边的框并选择一个目录。之后,记下特定的文件扩展名。
默认情况下,它显示*.*。这意味着它将替换所有文件中的文本。但是,假设您要查找和替换所有.css文件中的文本。为此,只需输入*.css
如果要添加多个扩展,请像这样添加它们:
*.css,*.php,*.txt
另一方面,如果您想包含除.exe和类似文件之外的所有文件。要排除特定扩展名,只需在“排除掩码”(Exclude Mask )部分输入以下内容,
*.exe
或者,
*.exe,*.dll
之后,您需要在“查找(Find )”框中输入文本。您可以输入单个单词或一行。
在下一步中,写下您要替换的文本。全部完成后,窗口将如下所示:
现在,您有两个选择。首先(First),您可以点击“替换(Replace )”按钮立即替换该文本。其次,您可以通过(Second)命令提示符(Command Prompt)获取您需要使用的命令来获得相同的东西。您将在“命令使用(Command Use )”框中获得一个命令,该命令如下所示:
"C:\Users\Sudip\Downloads\Programs\fnr.exe" --cl --dir "C:\Users\Sudip\Desktop\genesis" --fileMask "*.php,*.css" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "genesis" --replace "sudip"
在这里,C:\Users\Sudip\Downloads\Programs\fnr.exe 是查找(Find)和替换工具(Replace Tool)目录,C:\Users\Sudip\Desktop\genesis 是放置我所有文件的目录。
*.php,*.css 是包含的文件扩展名。
*.dll, *.exe 是排除的文件扩展名。
只需复制命令并将其粘贴到您的命令提示符(Command Prompt)中。执行命令后,您将收到类似以下的消息:
就是这样!
如果你喜欢它,你可以从这里(here)(here)下载。
Find and Replace Text in Multiple Files in Bulk on Windows 10
Sometimes we need to find and replace text in more than one file. The problem bеgins when we try to do so after opening each file. Certainly, you neеd only a couple of seconds to find and reрlace text in two or three fileѕ. However, just imagine that you have fifty files and you need to find and replace three words in each file. How do you handle that? Don’t panic. Here is a simple free tool for Windows and this is called Find and Replace Tool. This portable software can find and replace text in multiple files within moments.
Find and Replace Text in Multiple Files
First, download Find and Replace Tool and open it. As this is portable software, you will not have to install it. After opening Find and Replace Tool, the following screen will appear,
The UI is uncluttered. Therefore, you will understand each and every option very quickly. However, just follow the following steps to find and replace text in multiple files using this free tool.
First, you need to select the Directory, where all the raw files are positioned. It will replace text in those files, which are placed in one folder.
Therefore, to select the directory, just click on the box next to the empty box and choose a directory. After that, write down the particular file extension.
By default, it shows *.*. This means that it will replace text in all files. However, suppose, you want to find and replace text in all .css files. To do so, just enter *.css
If you want to add multiple extensions, add them like this:
*.css,*.php,*.txt
On the other hand, if you want to include all files except .exe and similar. To exclude particular extension, just enter the following in the Exclude Mask section,
*.exe
Or,
*.exe,*.dll
After that, you need to enter the text in the Find box. You can enter either a single word or a line.
In the next step, write down the text you would like to replace with. After completing all, the window will look like this:
Now, you have two options. First, you can hit the Replace button to replace that text immediately. Second, you can get a command that you need to use through Command Prompt to get the same thing. You will get a command in the Command Use box, and the command looks like this:
"C:\Users\Sudip\Downloads\Programs\fnr.exe" --cl --dir "C:\Users\Sudip\Desktop\genesis" --fileMask "*.php,*.css" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "genesis" --replace "sudip"
Here, C:\Users\Sudip\Downloads\Programs\fnr.exe is the Find and Replace Tool directory and C:\Users\Sudip\Desktop\genesis is the directory, where all my files are placed.
*.php,*.css are the included file extensions.
*.dll, *.exe are the excluded file extensions.
Just copy the command and paste it in your Command Prompt. After executing the command, you will get a message similar to this:
That’s’ it!
If you like it, you can download it from here.