Not necessarily a ready-made script, but plenty of scripting languages can do 
that job in a few lines of code.

Here's a question for you:
How would the word "bearmouse" be counted?  As neither bear nor mouse because 
it's one word? Or as 1 bear and 1 mouse?

> On Jun 22, 2021, at 06:25, Zoe Barnett <[email protected]> wrote:
> 
> 
> Hello. I'm a BBEdit user and not familiar with scripting. I'm looking for a 
> script to do this:
> 
> I have a file list.txt like this:
> 
> ------------
> 
> dog
> 
> cat
> 
> mouse
> 
> bear
> 
> report
> 
> popular pet
> 
> recent report
> 
> ----------
> 
> 
> 
> And another file content.txt like this:
> 
> -------------
> 
> A recent report showed that a dog is the most popular pet, closely followed 
> by cat and bird. Unsurprisingly, no survey respondents liked snakes.
> 
> (para 2)
> 
> (para 3)
> 
> -----------------
> 
> 
> 
> I want a script that finds all the phrases in list.txt, highlights them in 
> content.txt, and outputs a text file like this:
> 
> ---------------
> 
> dog 1
> 
> cat 1
> 
> mouse 0
> 
> bear 0
> 
> report 1
> 
> popular pet 1
> 
> recent report 1
> 
> ------------------
> 
> 
> 
> The main thing is that the search terms can be more than one word.
> 
> Is there a script out there?
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "[email protected]" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/bbedit>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/79f5f025-8a5c-4c10-8261-49119ea49111n%40googlegroups.com.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/D1D94483-BD86-4BD5-A7A9-9E030DA65E2F%40gmail.com.

Reply via email to