Unix administration - number sort

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2006 > number sort





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author number sort
whcui@yahoo.com

2006-01-29, 9:32 pm

Hi,


Here is some data:
aaa,-1.09221e+06,-30955,35.569
bbb,1.13284e+06,67479,16.735
ccc,1.78407e+06,93986,20.9255
ddd,25.92,4,6.48
eee,108.65,25,4.32


I want to sort them by the second column. "sort -t, -n -k 2,2" does not
work. Maybe sort does not understand "e+06". Can any one help? I am
using /bin/sh on a solaris 8 server.


Thanks!

Stephane Chazelas

2006-01-29, 9:32 pm

On 27 Jan 2006 07:06:11 -0800, whcui@yahoo.com wrote:
[...]
> Here is some data:
> aaa,-1.09221e+06,-30955,35.569
> bbb,1.13284e+06,67479,16.735
> ccc,1.78407e+06,93986,20.9255
> ddd,25.92,4,6.48
> eee,108.65,25,4.32
>
>
> I want to sort them by the second column. "sort -t, -n -k 2,2" does not
> work. Maybe sort does not understand "e+06". Can any one help? I am
> using /bin/sh on a solaris 8 server.

[...]

Your question has already been anwered in comp.unix.shell.
Please don't multipost. Use crosspost instead if you need to
post in several newsgroups at a time (which should not be the
case for this question).

--
Stephane
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com