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[rKey]>1 then repeat for each item rItem in tArray[rKey] put rKey,rItem & return after tDupList end repeat end if end repeat Pete lcSQL Software <http://www.lcsql.com> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> On Thu, Nov 19, 2015 at 4:42 PM, Peter Haworth <p...@lcsql.com> wrote: > 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 tDupList > end if > end repeat > > Might have to upshift the array keys if case is a factor. > > > Pete > lcSQL Software <http://www.lcsql.com> > Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and > SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> > > On Thu, Nov 19, 2015 at 12:12 PM, JOHN PATTEN <johnpat...@me.com> wrote: > >> 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 using the following code that Bernd shared while ago: >> http://forums.livecode.com/viewtopic.php?f=9&t=6226#p28787 < >> http://forums.livecode.com/viewtopic.php?f=9&t=6226#p28787> >> >> …but it only works if i leave off my unique 6 digit IDs from my list of >> accounts, naturally. >> >> I would like to be able to identify the user accounts that are exact >> duplicates but then differentiate them by their unique 6 digit ID. So >> essentially, create a new list of just the duplicates and ids, i.e. >> >> ggarcia, 121212 >> ggarcia, 131313 >> >> Thanks in advance for any ideas! >> >> John Patten >> SUSD >> >> >> >> _______________________________________________ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode