gnu-misc-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort file without sort first line or first two lines ?


From: moonhkt
Subject: Re: sort file without sort first line or first two lines ?
Date: Mon, 24 Jan 2011 18:42:00 -0800 (PST)
User-agent: G2/1.0

On Jan 21, 10:00 pm, Barry Margolin <address@hidden> wrote:
> In article
> <address@hidden>,
>
>
>
>  moonhkt <address@hidden> wrote:
> > How to sort file without sort first line or first two lines ?
>
> > Text file as below
> > MTH    NUM
> > JAN    A      1
> > APR    C
> > FEB    B      1
> > MAR    D      1
>
> > Expect Output
> > MTH    NUM
> > JAN    A      1
> > FEB    B      1
> > APR    C
> > MAR    D      1
>
> { head -1 file; tail -2 file | sort +k 2; } > sortedfile
>
> --
> Barry Margolin, address@hidden
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***


Tried, Not worked.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]