• 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: Removing dupes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing dupes


  • Subject: Re: Removing dupes
  • From: kai <email@hidden>
  • Date: Mon, 20 Sep 2004 01:58:22 +0100


On Sat, 18 Sep 2004 17:31:17 +0200, Bernard Azancot <email@hidden> wrote:


I a looking of a classical simple routine to find +/- remove dupes in a text list.

OK, I'll throw in this vanilla one, too (possibly handy if quite a few dupes are anticipated):


set l to {"doughnuts", "eggs", "cheese", "doughnuts", "milk", "butter", "doughnuts", "baked beans", "milk", "tomato ketchup", "bread", "doughnuts", "butter", "baked beans", "eggs", "doughnuts"}

set text item delimiters to return
set l to return & l & return
set r to {}
repeat while (count l's paragraphs) > 2
	set i to l's paragraph 2
	set text item delimiters to return & i & return
	set l to l's text items
	set text item delimiters to return
	set l to l as string
	set r's end to i
end repeat
set text item delimiters to {""}
r

--> {"doughnuts", "eggs", "cheese", "milk", "butter", "baked beans", "tomato ketchup", "bread"}

---
kai

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: VB or c++ call in script
  • Next by Date: Re: VB or c++ call in script
  • Previous by thread: Re: removing dupes
  • Next by thread: Finder reliability copy/move large files
  • Index(es):
    • Date
    • Thread