a two-level 'sort' question

subPlanck_at_excite.com
Date: 03/25/05


Date: 25 Mar 2005 13:24:21 -0800

I'm stuck trying to sort a long list of files in the form:

Feb 24 13:50 060399_20a08.124
Feb 22 12:06 060399_20a09.035
Feb 22 12:06 060399_20a09.034

whereby the entries are first sorted/grouped by
sort -t_ -d -k 2.1,2.5
and each block is sorted in an ascending order by date.

man sort gives the following example to sort
     30 December
     23 MAY
     25 June
     10 June
sort -k 2M -k 1n
but I want to keep sorted blocks after the undersore as priority
blocks.

The way I see it, the problem is in having to switch filed separators,
an underscore and space, in the same sort expresasion. Can it be done?

I'd appreciate any suggestions, because none of my attempts have been
successful.

z.entropic



Relevant Pages

  • Re: a two-level sort question
    ... > whereby the entries are first sorted/grouped by ... > and each block is sorted in an ascending order by date. ... > man sort gives the following example to sort ... > but I want to keep sorted blocks after the undersore as priority ...
    (comp.unix.questions)
  • Re: a two-level sort question
    ... Barry Margolin wrote: ... >>and each block is sorted in an ascending order by date. ... >>man sort gives the following example to sort ... >>but I want to keep sorted blocks after the undersore as priority ...
    (comp.unix.questions)
  • Re: Fantasy Books not set in pseudo-Europe
    ... looking for this sort of thing and haven't read those, ... you have to go to the entries on the 1001 Nights and on "Persia" ... <Wheel of the Infinite> ... Fantasy rooted in no particular Earth historical culture is not, ...
    (rec.arts.sf.written)
  • How to sort the variable length objects in Lexicographical order?
    ... I am involved in the Agent development for providing the support for ... about the lexicographic ordering of the table entries with respect to ... Because we need to sort the connection table based on four parameters ...
    (comp.protocols.snmp)
  • Re: What is the fastest way to determine if folder has subfolders or not!?
    ... | This sort of stuff does work very nicely, and is a good way of storing ... in binary tree search on 6000 entries would take 12 steps. ... for faster getting of free units, and if there is none free, using last unit offset + 1)... ... I sew VMWare has sdk for their disk format maybe beter idea would be to use their disk driver and sdk for such job. ...
    (microsoft.public.vb.winapi)