Thanks for all the ideas everyone. I tried Richard's 'Process Duplicate lines' solution and it worked. It requires both files to have only word on each line, but I was fortunately able to finagle that. I did it with 'Leaving One' and 'duplicate lines to new document' checked, and the result was a new document showing me a list of words that appeared in both the original documents (and thus appeared twice in the spliced document).
~jason

On Jan 25, 2007, at 10:07 AM, Richard Dyce wrote:

Err... how about de-duping each individual file, and then splicing the two files together and then using the 'Process Duplicate lines..' with 'Matching all', 'Delete duplicate lines' and 'Unique lines to new document' options selected - result - two documents: one with all the words that are in both (duplicated) and one with one with all the words that aren't. Or have I missed what you wanted?

On 25 Jan 2007, at 15:32, Chris Pepper wrote:

At 3:46 PM +0100 2007/01/25, Jan Erik Moström wrote:
Reply to Jason R. Finley <[EMAIL PROTECTED]> 07-01-25 07:53:

I've looked high and low but can't figure out how to easily do this: I
have two text files.  In the first is a list of words (one word per
line), and for EACH of those words, I have to search and see if it
exists in the second text file. How can I automate this? (preferably
without reinventing the wheel) thanks very much,

Something like this might work

#!/usr/bin/perl -w

The simple shell script to search 'searchme' for each word in 'words' is:

[EMAIL PROTECTED]:~$ for w in `cat words`; do echo ; echo "$w:"; grep $w searchme; done

test:
is a test
test

nomatch:
[EMAIL PROTECTED]:~$ cat words
test
nomatch
[EMAIL PROTECTED]:~$ cat searchme
this
is a test
test


                                                Chris
--
Chris Pepper:               <http://www.reppep.com/~pepper/>
                            <http://www.extrapepperoni.com/>
Rockefeller University:     <http://www.rockefeller.edu/>

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>


--
Richard Dyce MA (Cantab.) MBCS MIET

http://www.macuser.co.uk
http://www.macworld.co.uk



--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>



--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to