Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2001 13:21:51 +0000
From:      setantae <setantae@submonkey.net>
To:        Wayne Pascoe <freebsd@molemanarmy.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Sort
Message-ID:  <20011120132151.GB77414@rhadamanth>
In-Reply-To: <86r8qt7gjq.fsf@pan.ehsrealtime.com>
References:  <86r8qt7gjq.fsf@pan.ehsrealtime.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 20, 2001 at 12:50:01PM +0000, Wayne Pascoe wrote:
> Hi all,
> 
> I have a cvs file as follows :
> 
> id,first_name,last_name,company_name
> 
> I want to sort this on first name. Doing
> cat file.csv | sort 
> sorts starting at the beginning of the line. 
> 
> Is there a way for sort to sort a file based on a field delimited by a
> character, or should I just use a perl script ? 

Yes. See sort(1) and the -t and -k options.

Ceri

-- 
keep a mild groove on

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011120132151.GB77414>