On Jul 06, 2012, at 15:17, Peter Pinch wrote:
> I'm doing a Multi-File Search and would like to generate a list of the files 
> that contain the search string.
> ...
> Is there a way to get the full path to the files in the search result?

______________________________________________________________________

Hey Peter,

I don't know if this behavior has changed, but it does seem like there should 
be an option to copy the full path of the files.

I did look through both the expert prefs and the user manual and didn't find 
such an option.

Perhaps you should send a feature suggestion to support: Bare Bones Software 
<[email protected]>

In the meantime it's not difficult to use a command-line tool in a BBEdit 
worksheet to get what you're looking for.

Open a worksheet, paste the text, change the directory path as needed, 
select-all, hit Cmd-Return.

dir=~/test_directory/
cd "$dir"
egrep -ilr "\bsed\b" | sed "s#^#$dir#"

RESULT:

/Users/chris/test_directory/file.txt
/Users/chris/test_directory/SED_TEST_DIR/some_sed_stuff.txt
/Users/chris/test_directory/sort_test.txt
/Users/chris/test_directory/test.txt

Use 'man grep' in a worksheet to learn more about grep's options.

Okay, now let's do it with BBEdit's own 'bbfind' command-line tool.

bbfind -g "\bsed\b" ~/test_directory/ | sed -E 's/:.+$//' | sort -u

RESULT:

/Users/chris/test_directory/SED_TEST_DIR/some_sed_stuff.txt
/Users/chris/test_directory/file.txt
/Users/chris/test_directory/sort_test.txt
/Users/chris/test_directory/test.txt

Scope out 'man bbfind' for more info.

'bbfind' doesn't have as many options as 'grep', but it does have a more 
expansive regular expression set (PCRE).

--
Best Regards,
Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
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>

Reply via email to