From owner-freebsd-questions@FreeBSD.ORG Thu Apr 9 14:10:50 2009 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 26FE7106566B for ; Thu, 9 Apr 2009 14:10:50 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id D80ED8FC19 for ; Thu, 9 Apr 2009 14:10:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-196-108-192.dynamic.qsc.de [92.196.108.192]) by mx01.qsc.de (Postfix) with ESMTP id 631B73E; Thu, 9 Apr 2009 16:10:35 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n39EAStl001873; Thu, 9 Apr 2009 16:10:28 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 9 Apr 2009 16:10:28 +0200 From: Polytropon To: freebsd-questions@freebsd.org, lconrad@Go2France.com Message-Id: <20090409161028.cc669c2d.freebsd@edvax.de> In-Reply-To: <200904091332.n39DWpDs037047@lurza.secnetix.de> References: <200904082253.AA2466447562@mail.Go2France.com> <200904091332.n39DWpDs037047@lurza.secnetix.de> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: lconrad@Go2France.com, Oliver Fromme , freebsd-questions@freebsd.org Subject: Re: awk question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 14:10:50 -0000 On Thu, 9 Apr 2009 15:32:51 +0200 (CEST), Oliver Fromme wrote: > If ";" is the delimiter character, you need to tell awk > about it (i.e. use the -F option). This one should work: > > awk -F';' '$3 ~ /^[a-z]{5}$/ {print}' file You can even omit {print} because it's the default action (to print the whole line, i. e. $0) when no action is given for a pattern. % awk -F';' '$3 ~ /^[a-z]{5}$/' file When using this in a shell, keep an eye on eventually needed quoting or escaping of $. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...