Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort data

Status
Not open for further replies.

krava

Programmer
Jun 4, 2007
48
YU
Hi

I would like to sort datatable by column 2 for example. I wrote this:

awk '{a[$2>=10?$2:0$2]=$0} END {n=asorti(a,dest); for
(i=1;i<=n;i++){print dest}}' sample1.dat


It works but fails when I have negative numbers in datatable. Is there some quick solution for this?


thanks
k.
 
In unix you may simply use the sort command with the -k and -n options.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top