Re: Sorting by sequence member`
- Posted by Tony Steward <tony.steward at gmail.com> Oct 10, 2004
- 385 views
Thanks Kat but where do I find sorttok. On Sun, 10 Oct 2004 00:46:47 -0500, Kat <gertie at visionsix.com> wrote: > > > On 10 Oct 2004, at 15:28, Tony Steward wrote: > > > > > How can I sort the following sequence by 2nd, or 3rd member, using > > nat_sort preferably. > > > > > > {{"tony","nsw","Australia"},{"George","qld","Australia"},{"Mary","ca","USA"}} > > > > ie: how do I sort by state or country > > Use sorttok() or sortntok(): > > string = {"Fred,Astaire,45,Alberta,Canada", > "Lucy,Ball,56,Barre,North Dakota", > "Red,Skelton,34,London,England", > "Pierre,du Pont,12,Paris,France"} > string = sorttok(string,3,',') > string = {"Pierre,du Pont,12,Paris,France", > "Red,Skelton,34,London,England", > "Fred,Astaire,45,Alberta,Canada", > "Lucy,Ball,56,Barre,North Dakota"} > > It's also sorts *inside levels of sort*, so you can sort by country and inside > that sort > by state/provence and inside that sort by name,, nesting up to the limit of > how many > fields there are, in one sorttok() call. You can mix up and down sorting in > the levels. > > Kat > > > > > -- Regards Tony Steward www.locksdownunder.com IF IT IS TO BE IT IS UP TO ME!