Re: Removing dupes
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