Saving search results

11 views
Skip to first unread message

Bull

unread,
Oct 9, 2008, 9:17:56 AM10/9/08
to BBEdit Talk
Thanks to all who helped with my search question yesterday. My next
step in my project requires saving a list of all words that matched
the search string.

I tried selecting and copying the entries in the Search Results pane,
but got screwy results. To illustrate, I searched the list of
dictionary words for three-letter words with no repeats (yesterday's
drill). The Search Results pane shows several entries, the first two
of which say:

File 109582 Words.txt; Line 82: abc
File 109582 Words.txt; Line 208: abo

I thought I could just select and copy the entries, paste them into a
new document, clean up the stuff before the colon, and be done. But
when I select, copy, and paste those two entries I get this:

/Volumes/Kingston/Etc/Var/109582 Words.txt:82: abc
abdicable
/Volumes/Kingston/Etc/Var/109582 Words.txt:208: abo
aboard

The word "File" has been replaced with the file path, which is OK
since I'm going to cut it out anyway. What is strange, however, is the
inclusion of lines "abdicable" and "aboard". These two words happen to
follow "abc" and "abo" in the word list.

I can't be the first guy to want to save search results, so I figure
I'm missing something. I searched the BBEdit Manual and Help, but
didn't see anything.

Any ideas?

Bull

Dennis

unread,
Oct 9, 2008, 11:19:38 AM10/9/08
to bbe...@googlegroups.com
On Oct 9, 2008, at 6:17 AM, Bull wrote:

> My next step in my project requires saving a list of all words that
> matched
> the search string.

It sounds like you're looking for the Text -> Process Lines Containing
command. It has an option to copy matches to a new document.

Note that, as stetner pointed out earlier, you'll need to make a minor
change to your expression:

> This does not work in 'process lines containing' for it to work there
> you need to use this (note use $ rather than \r):
> ^(.)(?!\1)(.)(?!\1|\2)(.)$

Hope this helps,
Dennis

Patrick James

unread,
Oct 9, 2008, 11:36:48 AM10/9/08
to bbe...@googlegroups.com
Hi

I think that Text -> Process Lines Containing will create a list of
all the lines containing the three letter found strings.

However the required list could be created in two "moves" I suspect.

First put a return character before and after each three letter string.

Replace: \r&\r

(& matches all the found expression)

Then use Process Lines Containing to separate out those lines and put
them into a new document.

If this was a regular thing then a nice Text Factory could be created
to do it methinks.

Patrick

http://www.patrickjames.co.uk

Patrick James

unread,
Oct 9, 2008, 11:47:38 AM10/9/08
to bbe...@googlegroups.com
Hi

I've just noticed that the original thing being worked on is already a
list of words each on a separate line, so "Process Lines Containing"
will be ideal on its own :)

Patrick

http://www.patrickjames.co.uk

Begin forwarded message:

Bull

unread,
Oct 9, 2008, 1:23:53 PM10/9/08
to BBEdit Talk
Quite right, Patrick, "Process Lines Containing" works like a charm.
Thanks to you and Dennis.

Patrick James

unread,
Oct 9, 2008, 1:44:28 PM10/9/08
to bbe...@googlegroups.com
It was Dennis who suggested it, I just confused things for a bit :)

I find that "Process Lines Containing" to be very useful.

Patrick

http://www.patrickjames.co.uk

Reply all
Reply to author
Forward
0 new messages