I have a (deeply nested) directory containing 10s of thousands of wolfram files (mostly notebooks (nbs), but also scripts (.wls), packages (.m, .q wl), my and wxf data) and many subfolders each with a few hundred notebooks on average. Each notebook contains 10-100 of pages. I want to search on text in the files and within relevant notebook cells types e.g. Code, Text, Title, SubTitle, Item, Program, ExternalLanguage, etc.

I'd like to have a live search interface to quickly search through the contents of all files and visually show the matches highlighted within their context.

Is there an existing project or best practices for doing this?

The TextSeach related wolfram symbols are old and seem slow/weak, can mma even do this? Mma is obviously needed to preview the content of matches within notebooks, but what other tools would be used to build such a live deep search?

  • 1
    $\begingroup$ Excellent question. Can anything outside MMA search sets of notebooks, for a "specific variable" for instance? This is a tool/question, I'd like answered too. $\endgroup$
    – prog9910
    Jun 11, 2021 at 5:00
  • 1
    $\begingroup$ What exactly is the issue with the TextSearch tools? They are neither particularly old (introduced in version 10.2), nor do the seem too slow after the initial index creation from my quick testing. (To be fair, I did not test it on such huge numbers of notebooks). $\endgroup$
    – Lukas Lang
    Jun 12, 2021 at 19:08
  • $\begingroup$ TextSearch works for text files but not too well on many large notebooks with lots of graphics. Have you tried with a few long notebooks? I'm thinking about preprocessing all of them and exproting the cell contents to txt files $\endgroup$
    – M.R.
    Jun 14, 2021 at 23:24
  • 1
    $\begingroup$ If you only want to find cell types you can always grep as a pre-filter (fast) and then use Mathematica tools as the secondary step (slow). You could also use grep to build a token list for cell types and use that as an index. A similar thing could be done to get simple patterns like the Cell["*", "Section" which you could use to build a tag list of sections/subsections in notebooks that you can then do a more sophisticated on-demand filter of by actually opening and preprocessing the content $\endgroup$
    – b3m2a1
    Jun 14, 2021 at 23:30
  • 1
    $\begingroup$ @bRost03 Right? But that's what is needed. For something like (2) check out resources.wolframcloud.com/FunctionRepository/resources/… $\endgroup$
    – M.R.
    Jun 24, 2021 at 19:52

1 Answer 1


There is an MMA Notebook Indexer Tool at Wolfram Library Archive It only works on MacOS 10.4 from 2005. Otherwise, printing to PDF, and using PDF searching tools is another possibility.

Even though, there seems to be an issue of MMA exporting to PDF. No prob, I just print to Save as PDF. Time is certainly a factor. However, I would encourage others than myself, to answer the root of the question. PDF printing is best when it was created, certainly.

  • 1
    $\begingroup$ "Save as PDF myself" for thousands of notebook each of 10-100 pages. Please, could your estimate time needed for the "solution"? $\endgroup$
    – Acus
    Jun 11, 2021 at 5:41
  • $\begingroup$ Unless there is a way to maintain meta-data with your MMA notebooks? How else can it be done. We need Wolfram Research to take the lead on this. Not leave it to the user, to find answers. $\endgroup$
    – prog9910
    Jun 11, 2021 at 15:22
  • $\begingroup$ The application is too old, doesn't install anymore... $\endgroup$
    – user5601
    Jun 12, 2021 at 5:33
  • $\begingroup$ @prog9910 Wow 16 years old, nice archeology! In the link WRI said they would open-source it, but I can't tell if they every did... Do you know of any newer such projects that work on recent operating systems like MacOS 11+? $\endgroup$
    – M.R.
    Jun 24, 2021 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.