Re: What is Best Method To Determine Duplicate Items in a Large List?
Re: What is Best Method To Determine Duplicate Items in a Large List?
- Subject: Re: What is Best Method To Determine Duplicate Items in a Large List?
- From: Jim Underwood <email@hidden>
- Date: Mon, 14 Aug 2017 15:07:51 +0000
- Thread-topic: What is Best Method To Determine Duplicate Items in a Large List?
Shane,
Thanks. That worked, after I identified the correct line to change. The dup
list, IndexInfo, is now sorted by the Note Title (from source list).
The lines to change should be:
REPLACE THIS:
set duplicatedValues to countedDupes's allObjects()
WITH THIS:
set duplicatedValues to countedDupes's allObjects()'s
sortedArrayUsingSelector:"compare:"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I had another idea, inspired by Nigel's comment on keeping the order of the dup
list the same as the source list.
What about sorting the dup list on item 2 in each sublist, since it appears to
be the index of the first dup found?
IndexInfo List:
[cid:B14A81D3-AD9C-448D-969B-89BE33274AC3]
So, how do we sort IndexInfo on item 2?
Best Regards,
Jim Underwood
aka JMichaelTX
From: Shane Stanley
<email@hidden<mailto:email@hidden>>
Date: Monday, August 14, 2017 at 2:10 AM
To: "ASUL (AppleScript)"
<email@hidden<mailto:email@hidden>>
Subject: Re: What is Best Method To Determine Duplicate Items in a Large List?
On 14 Aug 2017, at 1:36 pm, Jim Underwood
<email@hidden<mailto:email@hidden>> wrote:
Is it possible to retain the order of the source list (theBigList) in the
resulting dup list (indexInfo)?
My source list is Note Titles that I have sorted in alphanumeric order, but the
script seems to ignore this.
The quickest would be to sort the duplicates, changing this:
set theDupes to theCountedSet's allObjects()
to:
set duplicatedValues to countedDupes's allObjects()'s
sortedArrayUsingSelector:"compare:"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden