0

I have a folder containing over 100 tiny json files, looking for a way to search through the actual code of these files for specific words and filter down to just the files that contain the search term.

Finder doesn't seem to do it, unless there's an attribute I'm not seeing. Perhaps there's another app for this?

I found this similar post but it has a link for how to add XHTML files but I don't know enough coding to understand how to adapt this to JSON files.

Why doesn't OS X Spotlight search inside .json files?

Any help is appreciated!

1
  • Has spotlight indexed the directory yet? Words from files should show up in finder search if spotlight has properly indexed the folder.
    – anonymous
    Oct 19, 2021 at 22:29

2 Answers 2

1

If you're not scared of terminals ...

In finder, right-click the folder, go to services, select open Terminal here

Then:

grep -l searchterm *json
15
  • I'm not scared of Terminal, but what I need is something that will update in real time. So say I have an active search in Finder on a Dropbox folder as co-workers add files to the folder, the new matching items will show up in the results list. Does that make sense?
    – RobertK
    Oct 19, 2021 at 21:18
  • @RobertK That makes sense. Have you stumbled upon this page in your farings? Seems to do what you're asking.
    – tink
    Oct 19, 2021 at 21:23
  • P.S.: I had no idea that spotlight also indexes cloud services.
    – tink
    Oct 19, 2021 at 21:25
  • will installing for Spotlight also add this functionality to Finder? The reason I ask is I need to keep working while this runs in the background and having a Finder window on the side of my screen makes sense since you can't have Spotlight open and work at the same time.
    – RobertK
    Oct 19, 2021 at 21:29
  • It would appear so ... I just worked the magic described above and searching for certain words in finder turns up matching json files.
    – tink
    Oct 19, 2021 at 21:43
0

Find Any File (FAF) by Thomas Tempelmann is the tool of choice for searching files by text content.

You can find it here: FAF

1
  • This is wonderful! Would love something with real-time updating of results but I can work with this. Thanks @Gilby
    – RobertK
    Oct 19, 2021 at 22:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .