Re: Sorting Lists???
Re: Sorting Lists???
- Subject: Re: Sorting Lists???
- From: John Delacour <email@hidden>
- Date: Sat, 22 Mar 2003 22:21:46 +0000
- Mac-eudora-version: 6.0a13
At 6:58 pm +0100 22/3/03, Jakob Peterhdnsel wrote:
Hi All.
I would like to sort a list.
List looks like this:
(*1, Library, 2, 80s Music, 3, De allerbedste, 4, Top 25 Most Played,
5, Sidst spillet, ...
It's 42 items: {n, "itemname"}
I would - surprise - like to sort the list in alphabetic order by the
'itemname'
set ls to "5,e,4,d,2,c,3,a,1,b"
do shell script "perl -e '$list = qq~" & ls & "~ ;
%hash = split q~,~, $list ;
@values = sort (values %hash) ;
for $key (sort keys %hash) {
print qq~$key $values[$i]$/~ ;
$i++ ;}'"
If certain characters appear in ls, then you will have to modify the
script to write and read to a file.
JD
_______________________________________________
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.