From owner-freebsd-questions@FreeBSD.ORG Thu Jul 26 20:22: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 4AEC116A41B for ; Thu, 26 Jul 2007 20:22:16 +0000 (UTC) (envelope-from ulrich@pukruppa.net) Received: from pukruppa.net (pukruppa.net [213.146.114.24]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA2C13C46E for ; Thu, 26 Jul 2007 20:22:15 +0000 (UTC) (envelope-from ulrich@pukruppa.net) Received: from pukruppa.net (localhost [127.0.0.1]) by pukruppa.net (8.14.1/8.14.1) with ESMTP id l6QJloOp055722 for ; Thu, 26 Jul 2007 21:47:50 +0200 (CEST) (envelope-from ulrich@pukruppa.net) Received: from localhost (ulrich@localhost) by pukruppa.net (8.14.1/8.14.1/Submit) with ESMTP id l6QJln7U055719 for ; Thu, 26 Jul 2007 21:47:50 +0200 (CEST) (envelope-from ulrich@pukruppa.net) Date: Thu, 26 Jul 2007 21:47:49 +0200 (CEST) From: "P.U.Kruppa" X-X-Sender: ulrich@small To: freebsd-questions@freebsd.org Message-ID: <20070726214006.X54947@small> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: 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: Thu, 26 Jul 2007 20:22:16 -0000 Hi (and sorry for this slightly OT question), I would like to extract the second last field of each line of a file called user.csv . So I try > awk '{print $(NF-1)}' user.csv awk: trying to access out of range field -1 input record number 1, file user.csv source line number 1 Obviously $(NF-1) doesn't do the trick. Any better idea? Thanks, Uli. Peter Ulrich Kruppa Wuppertal Germany