From owner-freebsd-stable@FreeBSD.ORG Fri Sep 22 06:59:23 2006 Return-Path: X-Original-To: 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 9B08716A47B for ; Fri, 22 Sep 2006 06:59:23 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from kagate.punkt.de (kagate.punkt.de [217.29.33.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id A95FD43D69 for ; Fri, 22 Sep 2006 06:59:22 +0000 (GMT) (envelope-from hausen@punkt.de) Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [10.0.0.110]) by kagate1.punkt.de with ESMTP id k8M6xL6W016067 for ; Fri, 22 Sep 2006 08:59:21 +0200 (CEST) Received: from hugo10.ka.punkt.de (localhost [127.0.0.1]) by hugo10.ka.punkt.de (8.12.10/8.12.10) with ESMTP id k8M6xIa9078053; Fri, 22 Sep 2006 08:59:18 +0200 (CEST) (envelope-from ry93@hugo10.ka.punkt.de) Received: (from ry93@localhost) by hugo10.ka.punkt.de (8.12.10/8.12.10/Submit) id k8M6xFGl078051; Fri, 22 Sep 2006 08:59:15 +0200 (CEST) (envelope-from ry93) Date: Fri, 22 Sep 2006 08:59:15 +0200 From: "Patrick M. Hausen" To: Matt Emmerton Message-ID: <20060922065915.GA77932@hugo10.ka.punkt.de> References: <54894.192.168.0.10.1158706436.squirrel@webmail.sd73.bc.ca> <002101c6dc46$470b1d50$0000fea9@gsicomp.on.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002101c6dc46$470b1d50$0000fea9@gsicomp.on.ca> User-Agent: Mutt/1.5.10i Cc: stable@freebsd.org, SigmaX asdf 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: Fri, 22 Sep 2006 06:59:23 -0000 Hi, all! On Tue, Sep 19, 2006 at 07:49:42PM -0400, Matt Emmerton wrote: > > cat file | awk -F"," '{ printf "%s,%s,%s,%s,%s\n",$1,$2,$3,$4,$5 }' > > > newfile > > What's wrong with this? > > cat file | cut -f-5 -c';' > newfile Both commands suffer badly from useless use of cat(1) ;-)) See http://sial.org/howto/shell/useless-cat/ for one of the dozens of explanations on the web. SCNR, Patrick -- punkt.de GmbH Internet - Dienstleistungen - Beratung Vorholzstr. 25 Tel. 0721 9109 -0 Fax: -100 76137 Karlsruhe http://punkt.de