Good morning,

On 23/10/14 at 12:25 PM -0700, [email protected] wrote:

I am not new to BBEdit but I have never done any scripting, and it seems that text factory will not do what I want so I am looking for pointers to scripts or whatever to do this:

1. Run multi finds using a series of grep searches (not replaces). There might be up to 10 or more searches. 2. Put the output found (results) into one document so they are all together (prefixed by document path where they were found)

I know I can do this manually but I would really like it to be automated and guess it has to be applescript (or perl).

You just described `grep` command line. You will probably need to read some docco:

From command line (Terminal):
  man grep

Or online:
  https://www.gnu.org/software/grep/manual/grep.html

Put all your search patterns in one file (eg. search-patterns.txt):
search.*1 pattern
pattern.*2
search.*10

Then run grep

  grep -R -f search patterns.txt path/to/files/ > found-results.txt
  bbedit found-results.txt

Or go straight to bbedit:

  grep -R -f search patterns.txt path/to/files/ | bbedit found-results.txt

If you want to avoid Terminal, then run the above in a BBEdit worksheet.

Note, grep has regular and 'extended' regex syntax, which is why I said you may need to read docco. It depends on how complex your search terms are.


Charlie

--
   Charlie Garrison  <[email protected]>
   github.com/cngarrison   metacpan.org/author/CNG

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.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 post to this group, send email to [email protected].

Reply via email to