MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: sort list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47235] Re: sort list
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 31 Mar 2004 02:59:16 -0500 (EST)
  • Organization: Universitaet Leipzig
  • References: <c4be1n$702$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

lst = Table[{StringJoin @@ 
        FromCharacterCode /@ {Random[Integer, {48, 64}], 
            Random[Integer, {32, 64}]}, Random[]}, {15}];

Sort[lst, Last[#1] < Last[#2] &]

??

Regards
  Jens

Guibout wrote:
> 
> Hi,
> I have a list of the form
> {{something1,x1},{something2,x2},{something3,x3}} where x1,x2, x3 are
> numbers. I want to sort this list with respect to xi. In other word if
> x2<x3<x1 I want Mathematica to produce:
> {{something2,x2},{something3,x3},{something1,x1}}
> Thanks for your help
> Vincent


  • Prev by Date: Re: sort list
  • Next by Date: Re: Expansion of an exponential expression
  • Previous by thread: Re: sort list
  • Next by thread: RE: sort list