Re: Sorting Question

From: Mills, John T (John.T.Mills@ERAC.COM)
Date: Mon Jan 12 2004 - 16:28:56 EST


Yes I looked at that first. The output is not correct.

sort -nr does a sort from left to right, sorting
12302003
12292003
...
01102004

What I really need to do is sort on the last 4, then on the first
4 characters. Unfortunately "filename" varies in length.

Any thoughts?

Thanks,

John

-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of
John Jolet
Sent: Monday, January 12, 2004 2:07 PM
To: aix-l@Princeton.EDU
Subject: Re: [aix-l] Sorting Question

sort -nr.
On Mon, 2004-01-12 at 13:56, Mills, John T wrote:
> Give an output of 'ls -1 .':
>
> filename.image.01102004
> filename.image.12252003
> filename.image.12262003
> filename.image.12272003
> filename.image.12282003
> filename.image.12292003
> filename.image.12302003
>
> How could I use sort or/and awk to sort the list like this?
>
> filename.image.12252003
> filename.image.12262003
> filename.image.12272003
> filename.image.12282003
> filename.image.12292003
> filename.image.12302003
> filename.image.01102004
>
> Thanks,
>
> John T. Mills



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:29 EDT