Re: Checking for duplicates in lists
Re: Checking for duplicates in lists
- Subject: Re: Checking for duplicates in lists
- From: Emmanuel <email@hidden>
- Date: Mon, 12 Jan 2004 00:12:05 +0100
At 10:43 AM -0800 02/01/04, Christopher Nebel wrote:
>
On Jan 2, 2004, at 8:04 AM, Emmanuel wrote:
>
>
>
>----------- tested
>
>set x to change "^(.+)(\\r\\1)+" into "\\1" in x with regexp
>
>-----------
>
>
Nah -- use uniq(1), since that's what it's there for:
>
>
set x to do shell script "echo " & x & " | sort | uniq -d"
We don't really want to *suppress* duplicates, we want unique items.
(Furthermore we were return-separated)
set x to do shell script "echo " & x & " | tr '\\r' '\\n' | sort | uniq"
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.