Find files that don't contain text?

24 views
Skip to first unread message

Neil Faiman

unread,
Feb 17, 2023, 11:16:41 AM2/17/23
to BBEdit Talk Mailing List
One of those things that must be easy, but I haven’t been able to figure out how:

Given a set of files (specified in a Multi-File search dialog box), I want to find all the files that do NOT contain a string matching a grep pattern (specifically, a line beginning with the string “DecisionDate:").

The best idea I’ve got is to do a multi-file search for a grep pattern (?s)\A<something>\Z, where <something> describes a string that does not contain the pattern ^DecisionDate:. Only, I can’t think of any pattern that does that.

This is a one-shot problem, so I’d be perfectly happy with a command line solution (maybe using the find utility?).

Does anyone have any suggestions?

Thanks,
Neil Faiman

Rich Siegel

unread,
Feb 17, 2023, 11:18:59 AM2/17/23
to BBEdit Talk Mailing List
On 17 Feb 2023, at 11:16, Neil Faiman wrote:

> One of those things that must be easy, but I haven’t been able to figure out how:
>
> Given a set of files (specified in a Multi-File search dialog box), I want to find all the files that do NOT contain a string matching a grep pattern (specifically, a line beginning with the string “DecisionDate:").

The "Exclude Matches" option in the Multi-File Search window will do that for you.

Enjoy,

R.

Neil Faiman

unread,
Feb 17, 2023, 11:53:58 AM2/17/23
to BBEdit Talk Mailing List
Well, that was even easier than I expected. (And before I progressed to my obvious next question, I took the extra fifteen seconds to discover the “Results Browsers” category in the “Search in: box.)

With BBEdit, there is always a way.

> Enjoy,

I will! Thanks

Neil

Reply all
Reply to author
Forward
0 new messages