From owner-freebsd-questions@FreeBSD.ORG Thu Aug 21 13:01:57 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 A051A1065671 for ; Thu, 21 Aug 2008 13:01:57 +0000 (UTC) (envelope-from Matthias.Apitz@oclc.org) Received: from mail.pica.nl (mail.pica.nl [192.87.44.30]) by mx1.freebsd.org (Postfix) with ESMTP id 3A67A8FC1F for ; Thu, 21 Aug 2008 13:01:56 +0000 (UTC) (envelope-from Matthias.Apitz@oclc.org) Received: from rebelion.Sisis.de ([193.31.10.34]) by mail.pica.nl with Microsoft SMTPSVC(6.0.3790.3959); Thu, 21 Aug 2008 15:01:55 +0200 Received: (from guru@localhost) by rebelion.Sisis.de (8.14.2/8.13.8/Submit) id m7LD1sjE011297; Thu, 21 Aug 2008 15:01:54 +0200 (CEST) (envelope-from matthias.apitz@oclc.org) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to matthias.apitz@oclc.org using -f Date: Thu, 21 Aug 2008 15:01:54 +0200 From: Matthias Apitz To: Joseph Olatt Message-ID: <20080821130154.GA11071@rebelion.Sisis.de> References: <48AD63B7.8090107@ibctech.ca> <20080821055429.A26910@eskimo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080821055429.A26910@eskimo.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.0-RELEASE (i386) X-OriginalArrivalTime: 21 Aug 2008 13:01:55.0266 (UTC) FILETIME=[1663FA20:01C9038E] Cc: Steve Bertrand , freebsd-questions@freebsd.org Subject: Re: sed/awk, instead of Perl X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 13:01:57 -0000 El día Thursday, August 21, 2008 a las 05:54:29AM -0700, Joseph Olatt escribió: > Try the following: > > > cat t.txt | awk -F\t '{split($1, arr, "."); printf("%s_%s@%s\n", arr[ > 1], arr[2], $2);}' > > where t.txt: > john.doe example.com Despite of the magic awk(1) or while-loops: this is all UUOC Award; http://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat :-) matthias -- Matthias Apitz Manager Technical Support - OCLC GmbH Gruenwalder Weg 28g - 82041 Oberhaching - Germany t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.oclc.org/ http://www.UnixArea.de/ b http://gurucubano.blogspot.com/ We should all learn from the peoples of The Netherlands, France and Ireland. Aprendamos todos de los pueblos de Holanda, Francia e Irlanda.