Re: bash - sort command - can I sort by a certain field?

From: Alex Hunsley (lardattardisdoteddotacdotuk_at_mailinator.com)
Date: 12/02/04


Date: Thu, 02 Dec 2004 12:02:21 +0000

Alex Hunsley wrote:
> I'd like to use a bash command to sort a file by a certain field in that
> file.
> I've looked at sort but I can't see how to do it - interestingly, the
> docs say the -t option is for specifying a delimiter, but then I can't
> see anything else obvious about saying which field you'd like to sort by!
> If sort can't do this directly, I'm sure something is possible using cut
> + sort together, but the exact form eludes me at the moment!
>
> thanks
> alex

D'OH!
I've just discovered, via random web pages, that I can do:

sort +1 file.txt

... to sort by a certain field. My Cygwin man page says *nothing* about
this ability - why this oversight?

alex



Relevant Pages

  • Re: arod
    ... Tom K wrote: ... For me that would sort of match what Jeff ... Albert was hypothesizing about Alex not being able to synchronize the ... without rest groin injuries can linger for a ...
    (alt.sports.baseball.ny-yankees)
  • Re: arod
    ... Tom K wrote: ... For me that would sort of match what Jeff ... Albert was hypothesizing about Alex not being able to synchronize the ... without rest groin injuries can linger for a ...
    (alt.sports.baseball.ny-yankees)
  • Re: Obamas school speech came and went...
    ... prove she's got bigger balls and more guns than some group she wants to investigate. ... Gee...have you read history, Alex? ... for any sort of modern firearm. ... That's why the Swiss are only required to keep about 50 rounds in a "battle pack". ...
    (alt.smokers.cigars)
  • Re: bash - sort command - can I sort by a certain field?
    ... > Alex Hunsley wrote: ... >> I'd like to use a bash command to sort a file by a certain field in that ... >> see anything else obvious about saying which field you'd like to sort by! ...
    (comp.unix.shell)
  • Re: Sort Function
    ... >Hi Alex ... to use a helper ... >> excel worksheet. ... >> name and then sort, but there is a lot of data and I ...
    (microsoft.public.excel.worksheet.functions)