• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What is Best Method To Determine Duplicate Items in a Large List?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:"

PNG image

 _______________________________________________
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

  • Follow-Ups:
    • Re: What is Best Method To Determine Duplicate Items in a Large List?
      • From: Shane Stanley <email@hidden>
References: 
 >Re: What is Best Method To Determine Duplicate Items in a Large List? (From: "Nigel Garvey" <email@hidden>)
 >Re: What is Best Method To Determine Duplicate Items in a Large List? (From: Shane Stanley <email@hidden>)
 >Re: What is Best Method To Determine Duplicate Items in a Large List? (From: Jim Underwood <email@hidden>)
 >Re: What is Best Method To Determine Duplicate Items in a Large List? (From: Jim Underwood <email@hidden>)
 >Re: What is Best Method To Determine Duplicate Items in a Large List? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Quicktime replacement?
  • Next by Date: Re: What is Best Method To Determine Duplicate Items in a Large List?
  • Previous by thread: Re: What is Best Method To Determine Duplicate Items in a Large List?
  • Next by thread: Re: What is Best Method To Determine Duplicate Items in a Large List?
  • Index(es):
    • Date
    • Thread