From owner-freebsd-questions@FreeBSD.ORG Sun Nov 2 04:38:01 2008 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 BF1381065674 for ; Sun, 2 Nov 2008 04:38:01 +0000 (UTC) (envelope-from gary@pattersonsoftware.com) Received: from mail.pattersonsoftware.com (mail.pattersonsoftware.com [121.52.192.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7B52C8FC1D for ; Sun, 2 Nov 2008 04:38:01 +0000 (UTC) (envelope-from gary@pattersonsoftware.com) Received: from localhost (mail [127.0.0.3]) by mail.pattersonsoftware.com (Postfix) with ESMTP id B7F554B7B32 for ; Sun, 2 Nov 2008 14:37:59 +1000 (EST) X-Virus-Scanned: amavisd-new at pattersonsoftware.com Received: from mail.pattersonsoftware.com ([127.0.0.3]) by localhost (mail.pattersonsoftware.com [127.0.0.3]) (amavisd-new, port 10024) with ESMTP id 3tiz6J5zJv50 for ; Sun, 2 Nov 2008 14:37:54 +1000 (EST) Received: from elegia (60-242-254-180.static.tpgi.com.au [60.242.254.180]) by mail.pattersonsoftware.com (Postfix) with ESMTPSA id 94C314B7B18 for ; Sun, 2 Nov 2008 14:37:54 +1000 (EST) Date: Sun, 2 Nov 2008 14:37:53 +1000 From: Gary Newcombe To: freebsd-questions@freebsd.org Message-Id: <20081102143753.d1f66ad9.gary@pattersonsoftware.com> In-Reply-To: <2daa8b4e0811011821q210ae3a5j8f612a0fc79e8844@mail.gmail.com> References: <2daa8b4e0811011821q210ae3a5j8f612a0fc79e8844@mail.gmail.com> Organization: Patterson Software X-Mailer: Sylpheed 2.5.0rc2 (GTK+ 2.12.12; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: OT: Shell Script using Awk 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: Sun, 02 Nov 2008 04:38:01 -0000 On Sat, 1 Nov 2008 18:21:55 -0700, "David Allen" wrote: > My apologies for asking on this list, but I'm stuck without Perl and need > to use awk to generate a report. > > I'm working with a large data set spread across multiple files, but to > keep things simple, say I have A Very Long String that containing records, > each delimited by a single space. I need to print those records in > columnar format, but with only 7 columns per line: > > record1 record2 record3 record4 record5 record6 record7 > record08 record09 record10 record11 record12 record13 record14 > ... > > Should be simple, but I'm getting nowhere. Is this what you're after? $ cat input col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 .... cat input | awk -F\ '{for (i=1;i > Thanks! > > -- > David "promising never to do this again" Allen > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"