Producing a list of duplicates

Dr. Hawkins dochawk at gmail.com
Wed Mar 22 12:25:21 EDT 2017


On Wed, Mar 22, 2017 at 4:41 AM, Skip Kimpel via use-livecode <
use-livecode at lists.runrev.com> wrote:

> I have a bunch of data records that contain email addresses. I need to
> search through that list and produce an list so those duplicates can be
> acted upon.
>

repeat for each line theLin in theList

add 1 to theVals[theLin]

if theVals[theLin] > 1 then

put theVals[theLin] into theDups[theLin]

end if

end repeat


theDups has duplicated addresses as it's keys, and the number of dups as
the values

Or, you could extend and parse the actual email address out of each line,
and use *that* as the key, to catch situations like

john at doe.com

<john at doe.com> "John Doe"
<john at doe.com> "Johnathan Doe"

In that case, I'd probably put

put theLin into theDups[theEmail][theVals[theEmail]]

so that you get a list for each type

-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list