How to find a set of files containing a certain phrase using MacOS graphical user interface

filesystemfindersearch

I am using a Macbook Pro with MacOS High Sierra. I have recently moved from Windows so I am quite new to Mac.

I have a folder of Xml files. I am trying to find the set of one type of the Xml file and drag that set of files into my Xml Editor to work on.

For example.

In Finder on Mac, create a directory in my Documents folder called "ExactSearchGui".

In that folder create one file called foo.xml with the following content:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<foo>
Hello
</foo>

Then, create another file in that folder called bar.xml with the following content:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bar>
    <fooIAmNot>
        I am not the file you are looking for.
    </fooIAmNot>
</bar>

Note how a Finder Search within the ExactSearchGui folder for "<foo>" finds any file containing foo including the file we don't want.

enter image description here

As I understand it from this question, Finder Search and Spotlight return false positives, So, I am looking for a method to search for an exact phrase within a set of text files using a graphical user interface on MacOS without producing false positives such as this. On a PC I would use grepWin to achieve the result. So, if you know some similar solution, or a native technique, it would be appreciated.

Best Answer

There is a 3rd party app named EasyFind that has a GUI interface and allows you to search for strings inside files. You can search your whole drive or a single folder. Click the settings button at the top left and select scan all files to make sure your file type is searched. It will search for a user-defined string. EasyFind is free and available from the MacApp store.