From owner-freebsd-stable@FreeBSD.ORG Tue Sep 19 16:35:59 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 916E316A403 for ; Tue, 19 Sep 2006 16:35:59 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id D913043D6B for ; Tue, 19 Sep 2006 16:35:54 +0000 (GMT) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net ([12.207.12.9]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20060919163553m9100smnhle>; Tue, 19 Sep 2006 16:35:53 +0000 Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.6/8.13.6) with ESMTP id k8JGZpcX052704; Tue, 19 Sep 2006 11:35:51 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.6/8.13.6/Submit) id k8JGZpvF052703; Tue, 19 Sep 2006 11:35:51 -0500 (CDT) (envelope-from brooks) Date: Tue, 19 Sep 2006 11:35:51 -0500 From: Brooks Davis To: SigmaX asdf Message-ID: <20060919163551.GB52635@lor.one-eyed-alien.net> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dTy3Mrz/UPE2dbVg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Cc: freebsd-stable@freebsd.org Subject: Re: sed and comma-delimited file X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2006 16:35:59 -0000 --dTy3Mrz/UPE2dbVg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 19, 2006 at 12:26:54PM -0400, SigmaX asdf wrote: > Yo; >=20 > I have a series of comma-delimited text files with fourteen columns of > data and several hundred rows. I want to use a short shell script to > strip them of the last 9 columns, leaving the same file but with just > five of its columns. I can do it in C++, but that seems like > overkill. How would I go about doing it with sed or a similar > utility? See cut(1): cut -d, -f1,2,3,4,5 -- Brooks --dTy3Mrz/UPE2dbVg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFEBxmXY6L6fI4GtQRArYeAJ0X2xtonmVoAF+478VJl0Wj6gx7TwCgoufr O4SZHaq9a/J4e/qLsSBdq58= =uRVl -----END PGP SIGNATURE----- --dTy3Mrz/UPE2dbVg--