MathGroup Archive 1997

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

Search the Archive

Re: Sorting tables by columns

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6417] Re: Sorting tables by columns
  • From: Dick Zacher <dick at loc3.tandem.com>
  • Date: Tue, 18 Mar 1997 22:16:31 -0500 (EST)
  • Organization: Tandem Computers
  • Sender: owner-wri-mathgroup at wolfram.com

fbd2 at psu.edu wrote:
> 
> Hi,
> 
> Does anyone know how to sort tables by one of its columns?

> Thanks,
> 
> Flavio


Flavio,

This will do it:

sortOnFirstColumn[matrix_]:=Sort[matrix,(First[#1]<=First[#2])&]

-- 
-----------------------------
Dick Zacher                    
Performance Engineering Dept., Tandem Computers
zacher_dick at tandem.com     phone: 408-285-5746     fax:   408-285-7079


  • Prev by Date: Printing in HelpBrower??
  • Next by Date: Attributes
  • Previous by thread: Re: Sorting tables by columns
  • Next by thread: system of non-linear ODEs