From owner-freebsd-questions@FreeBSD.ORG Fri Jul 27 16:00:16 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B33A16A417 for ; Fri, 27 Jul 2007 16:00:16 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.100.219]) by mx1.freebsd.org (Postfix) with ESMTP id 136B813C45E for ; Fri, 27 Jul 2007 16:00:15 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (localhost.cis.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.13.8/8.13.8) with ESMTP id l6RG0F4r036823 for ; Fri, 27 Jul 2007 11:00:15 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <200707271600.l6RG0F4r036823@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Date: Fri, 27 Jul 2007 11:00:15 -0500 From: Martin McCormick Subject: Re: awk question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 16:00:16 -0000 "n j" writes: > Or awk only i.e. no sed: > > awk '!(/^$/) { print $(NF-1) }' user.csv That's right. I originally suggested the sed and then was thinking about it as I walked home yesterday and knew that awk could test for the blank line condition before committing suicide.:-) Martin