• 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: Sorting Lists???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting Lists???


  • Subject: Re: Sorting Lists???
  • From: John Delacour <email@hidden>
  • Date: Sun, 23 Mar 2003 11:07:36 +0000
  • Mac-eudora-version: 6.0a13

At 8:44 pm -0600 22/3/03, [off-list] wrote:

But is there a way to sort it with caps first and then lowercase next? I'd like to end up with something like this:

----------------------------------------
1 A
2 a
3 B
4 b
5 c
6 d
7 e
8 f
9 g
10 h
----------------------------------------


This is the best I can come up with.

set ls to "b,B,a,h,N,d,A,D,n"
sortList(ls)

on sortList(ls)
do shell script "perl -e '$list = qq~" & ls & "~ ;
@array = split q~,~, $list ;
for (sort {lc $a cmp lc $b or $a cmp $b} @array) {
++$i ; print qq~$i\\011$_\\015~
}'"
end sortList

"1 A
2 a
3 B
4 b
5 D
6 d
7 h
8 N
9 n"
_______________________________________________
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.

  • Prev by Date: Re: What are the elements listed in a dictionary?
  • Next by Date: Re: What are the elements listed in a dictionary?
  • Previous by thread: Re: Sorting Lists???
  • Next by thread: How to make a background applet ?
  • Index(es):
    • Date
    • Thread