HoudahSpot is a file search tool that builds upon macOS Spotlight. You turn to HoudahSpot when you need to:
- Find a specific file. The proverbial needle in a haystack. A specific song. A letter you want to use as a template
- Browse files related to a specific task or subject. Review research material, documentation, client correspondence, etc.
- Collect files that share a common property. Tagged files. Photos and videos from last summer
What if you need a specific set of files? E.g. multiple files of which you have the names in an email, a CSV list, or a spreadsheet. HoudahSpot can help you with that too.
From a CSV List to a Collection of Files
Let’s imagine a friend or client has sent you a list of photos she wants a copy of.
You could, of course, search for the files one by one. With the right technique, this is not quite as tedious as it sounds. Still, you don’t want to do this for more than a handful of files.
IMG_1042.JPG, IMG_1043.JPG, IMG_1048.JPG, IMG_1050.JPG, IMG_1056.JPG, IMG_1063.JPG, IMG_1064.JPG, IMG_1065.JPG
Wouldn’t it be great if you could just paste that enumeration into HoudahSpot’s search field?
You can. Almost. You just need to make a few changes for HoudahSpot to understand what you want. This HoudahSpot search can find your friend’s files:
search:filename =IMG_1042.JPG OR =IMG_1043.JPG OR =IMG_1048.JPG OR =IMG_1050.JPG OR =IMG_1056.JPG OR =IMG_1063.JPG OR =IMG_1064.JPG OR =IMG_1065.JPG
First, you tell HoudahSpot to search by file name. Then you list the names you are looking for. Since you want all of those files, tell HoudahSpot that the names need to match one OR the other OR the next name in your list.
You want exact matches. For this, you add the equals sign before each file name.
Building a Search Query. The Find-Replace Method
What is missing now, is an easy way to get from the comma-separated list of names to a search query HoudahSpot can understand.
This actually just needs a bit of simple text editing. Apple’s TextEdit application will work fine for the task.
Start by copying the list to a new text do text document.
The original text has commas between the different names. The search query expects the OR operator. We thus need to find all occurrences of the comma and replace these with the word OR. Since we also want an equals sign before each file name, we add this in as we replace the commas.
Let’s make TextEdit do the work for us. Select File > Find > Find and Replace… from the menu. The find bar appears.
In the top field, enter: “, ” (without the quotes, but with the trailing space). In the bottom field enter ” OR =”. Now press the All button.
Almost done. This still lacks the equals sign in front of the first name. You need to type that.
Now paste “search:filename ” at the beginning of the line. This completes the search query.
Select all. Copy. Paste your query into the search field at the top of a HoudahSpot window.
You may want to adjust search Locations before you start the search. E.g. limit the search to the folder containing the photos.
Bonus Tip: Copy the Files
Now that HoudahSpot is showing the files your friend has requested, you can use copy-paste to save these to a USB stick or attach the files to an email.
Press command-c to copy the files. Switch to Finder. In Finder, navigate to the folder where you want to save copies. Press command-v.