I'm wondering why not use filter? For each line, in the list, copy the list to
a temp variable
put tList into tTemp
put item 1 of line tCurrentLine into tKey
filter tTemp with tKey & "*"
then check for duplicates:
if the number of lines of tTemp > 1 then put tTemp & cr after tDuplicates
If the
Sorry, the put in the second repeat should be "put rKey,tArray[rKey] &
return after tDuplist
This gives you one line per duplicate username so if you want a separate
line for each dup, the second repeat becomes:
repeat for each line rKey in the keys of tArray
if the number of items in tArray[r
I haven't seen Bernd's code but here's one way.
repeat for each line rLine in tUserlist
put item 2 of rLine & comma after tArray[item 1 of rLine]
end repeat
repeat for each line rKey in the keys of tArray
if the number of items in tArray[rKey]>1 then
put tArray[rKey] & return after tD
only six lines of code.
Craig Newman
-Original Message-
From: JOHN PATTEN
To: How to use LiveCode
Sent: Thu, Nov 19, 2015 3:14 pm
Subject: Script for finding duplicate accounts and identifying dups
Hi All,I have a list of user accounts and unique IDs. The user accounts
are first initia
rt the list, and
in a> "repeat with..." loop check each line with the line following. If they>
match, extract the two indexes. This should take only six lines of code.>>>
Craig Newman>>>> -Original Message-> From: JOHN PATTEN
> To: How to use Li
d then, why not sort the list, and in a
>> "repeat with..." loop check each line with the line following. If they
>> match, extract the two indexes. This should take only six lines of code.
>>
>>
>> Craig Newman
>>
>>
>>
>>
> "repeat with..." loop check each line with the line following. If they
> match, extract the two indexes. This should take only six lines of code.
>
>
> Craig Newman
>
>
>
> -Original Message-
> From: JOHN PATTEN
> To: How to use LiveCode
&g
Meant to put this in the last msg but oh well.
The output list ends up like this..
ijones,6,11
tbonner,32,38,45
qbonner,13,14
imojo,4,49
tmajor,5,20
umojo,12,29,48
qmojo,27,41
ugarcia,9,44
tjones,10,19
ygarcia,7,17
qminor,37,43
ebonner,39,50
The username dupes, and the Id's.
On Thu, Nov 19, 201
I like arrays for this sort of thing. I'm sure theres a more efficient way
to do it but here is code that might work ok.
on mouseUp
put field 1 into tData -- the list
repeat for each line tLine in tData
if tDataArray[item 1 of tLine] is empty then -- build the array keyed
by username
extract the two indexes. This should take only six lines of code.
Craig Newman
-Original Message-
From: JOHN PATTEN
To: How to use LiveCode
Sent: Thu, Nov 19, 2015 3:14 pm
Subject: Script for finding duplicate accounts and identifying dups
Hi All,I have a list of user accounts and uniqu
Hi All,
I have a list of user accounts and unique IDs. The user accounts are first
initial + last name. A typical list might look like the following:
jdoe, 123456
ggarcia, 121212
ggarcia, 131313
I’m trying identify the duplicates, list the username and their unique 6 digit
id.
I have been usi
11 matches
Mail list logo