How to get the difference between two lists?

Frank D. Engel, Jr. fde101 at fjrhome.net
Mon Apr 4 11:22:56 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Okay, so anyone want to report on this one (untested, but should be 
rather efficient):

This algorithm assumes that every item in the exclusion list is 
included in the master list, that there are no duplicate items in 
either list, and that both lists are in ascending numeric order:

put empty into targetList
put (excludeList & cr & 100000000000000000) into eCopy  -- use some 
absurdly huge
             -- number, guaranteed to not be in either list, and to be 
larger than the largest possible
             -- number in either list
put 1 into z
repeat for each line x in masterList
   if x < (line z of eCopy) then put (x & cr) after targetList
   else add 1 to z
end repeat
delete the last char of targetList


On Apr 4, 2005, at 10:27 AM, Jim Hurley wrote:

>>
>> Message: 6
>> Date: Sun, 03 Apr 2005 22:04:54 -0500
>> From: Ken Ray <kray at sonsothunder.com>
>> Subject: How to get the difference between two lists?
>> To: Use Revolution List <use-revolution at lists.runrev.com>
>> Message-ID: <BE761906.181CF%kray at sonsothunder.com>
>> Content-Type: text/plain;	charset="US-ASCII"
>>
>> I've got two lists - one with is the "comprehensive" list that is
>> return-delimited, like:
>> (snip)
>
>
> Ken,
>
> I wrote a short stack (non-pancake) a short time ago to deal with the 
> multitude of e-mail list among the various volunteer groups in my 
> community, extract duplicates, find common lines, etc.
>
> It will generate the both the intersection and the union of any two 
> lists. Don't know if this is any help but you can see with
>
>       go url "http://home.infostations.net/jhurley/CompareLists.rev"
>
> Jim
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
- -----------------------------------------------------------
Frank D. Engel, Jr.  <fde101 at fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCUVvQ7aqtWrR9cZoRAh7pAJ0ajDgAWnoR/007yYs3bio03xk8lQCfQhzo
FxOsMhZvTLt2NQF9ixuKDfk=
=1IIo
-----END PGP SIGNATURE-----



___________________________________________________________
$0 Web Hosting with up to 200MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com



More information about the use-livecode mailing list