FNR : Find and Replace Text in Multiple Files

On a Linux system, if we want to search and replace text inside a number of files then we can use the grep command. The grep command uses regular expressions to find the text strings inside the text files. It is so fast that it can search for a string inside thousands of files within a few seconds.

On Windows, we do not have the native grep command available unless you install the Linux sub-system. If you want to have the same functionality of grep on Windows as on Linux, then you can try an open-source tool called Find and Replace (FNR). It is a portable tool that can be used to search for strings inside hundreds of text files and optionally replace it with something else.

Upon launching FNR, we are presented a single window that shows all the options required for the tool to work. The same window is going to display the results and also the preview of the text files.

We begin by selecting a folder or drive which must be searched for text files. There are file masks and exclusion masks available. The string that we are looking for can be a plain text string or a regular expression string. We can choose the search text files only or choose to search through the binary files as well. Similarly, we can specify the replacement strings.

Find and Replace FNR

If we want to only find the strings, then we have to click on the Find Only button. If we want to replace the found text, then we have to use the Replace button. The results are shown in a list along with the filenames, paths, number of string matches in each of the files and more. A preview of the file contents with the found string highlighted is shown when we select any of these files in the list.

Conclusion: FNR is a grep alternative for Windows operating system. It works effortlessly even when we search through an entire hard disk drive. Unlike grep which works for only plain-text files, FNR is able to search through binary files as well.

You can download FNR from http://findandreplace.io/.