• 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: Graff <email@hidden>
  • Date: Sat, 18 Sep 2004 14:58:48 -0400

Assuming that the items in the text list are delimited by a character, such as a space:
----
-- the delimiter is a single space
set theDelim to " "
set the textList to "the the the the a the buh a a ruh the my a a"


set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to theDelim
set itemList to text items of textList

set newList to itemList
set tempList to itemList
set i to 1
repeat while i < (count of newList)
 set tempList to items 1 thru i of newList
 repeat with j from (i + 1) to (count of newList) - 1
  if ((item i of newList) is not equal to (item j of newList)) then
   copy item j of newList to end of tempList
  end if
 end repeat
 set i to i + 1
 set newList to tempList
end repeat

set newTextList to newList as text
set AppleScript's text item delimiters to oldDelims

-- show the stripped text
newTextList
----
- Ken

On Sep 18, 2004, at 11:31 AM, Bernard Azancot wrote:

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

Thanks in advance
Bernard

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


This email sent to email@hidden


_______________________________________________ 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
  • Follow-Ups:
    • Re: Removing dupes
      • From: Allen Watson <email@hidden>
References: 
 >Removing dupes (From: Bernard Azancot <email@hidden>)

  • Prev by Date: Finder reliability copy/move large files
  • Next by Date: select folder command in PowerMail
  • Previous by thread: Re: Removing dupes
  • Next by thread: Re: Removing dupes
  • Index(es):
    • Date
    • Thread