Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15713 > unrolled thread

Re: Sorting nested lists with strings

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-02-10 10:20 +0000
Last post2011-02-10 10:20 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Sorting nested lists with strings DrMajorBob <btreat1@austin.rr.com> - 2011-02-10 10:20 +0000

#15713 — Re: Sorting nested lists with strings

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-02-10 10:20 +0000
SubjectRe: Sorting nested lists with strings
Message-ID<ij0e4u$9a0$1@smc.vnet.net>
Since you're sorting by the first element, just write

Sort@list

or

SortBy[list,First]

Bobby

On Wed, 09 Feb 2011 01:09:52 -0600, Paperorbifold
<kgodelNOSPAM@liberonospam.it> wrote:

> I've a nested list of this kind:
> list={{"Paul",23},{"Amanda",55},{"Carl",32},...}
> Suppose I want to perform an alphabetic sort on the first element. Which  
> is
> the condition I've to write in Sort[list,...]?
> Actually Sort[list] automatically operates on the second element.
> Thanks.
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web