From owner-freebsd-questions@FreeBSD.ORG Thu Aug 21 23:22:15 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 492A21065672 for ; Thu, 21 Aug 2008 23:22:15 +0000 (UTC) (envelope-from walt@wump.org) Received: from mta21.charter.net (mta21.charter.net [216.33.127.81]) by mx1.freebsd.org (Postfix) with ESMTP id D30008FC12 for ; Thu, 21 Aug 2008 23:22:14 +0000 (UTC) (envelope-from walt@wump.org) Received: from aarprv06.charter.net ([10.20.200.76]) by mta21.charter.net (InterMail vM.7.08.03.00 201-2186-126-20070710) with ESMTP id <20080821232209.SURS9229.mta21.charter.net@aarprv06.charter.net>; Thu, 21 Aug 2008 19:22:09 -0400 Received: from [10.0.0.10] (really [68.116.98.9]) by aarprv06.charter.net with ESMTP id <20080821232208.MGZI29012.aarprv06.charter.net@[10.0.0.10]>; Thu, 21 Aug 2008 19:22:08 -0400 Mime-Version: 1.0 Message-Id: Date: Thu, 21 Aug 2008 16:22:04 -0700 To: Steve Bertrand , freebsd-questions@freebsd.org From: Walt Pawley Content-Type: text/plain; charset="us-ascii" X-Chzlrs: 0 Cc: Subject: Re: sed/awk, instead of Perl 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, 21 Aug 2008 23:22:15 -0000 At 4:19 PM -0700 8/21/08, Walt Pawley wrote: >At 3:49 PM -0700 8/21/08, Walt Pawley wrote: > >>At 8:46 AM -0400 8/21/08, Steve Bertrand wrote: >> >>>- read email addresses from a file in the format: >>> >>>user.name TAB domain.tld >>> >>>- convert it to: >>> >>>user_name@example.com >>> >>>- write it back to either a new file, the original file, or to STDOUT >> >>I'm curious why Perl isn't a decent choice. I think I'd do something like >> >>perl -pe 's/(.*?)\.(.*)\t.*/$1_$2@example.com/' input_file > output_file > >Which is also wrong. It gets a bit closer to Steve's desires I >suspect if one adds the appropriate backslash ... > >perl -pe 's/(.*?)\.(.*)\t.*/$1_$2@\example.com/' input_file > output_file > >Sorry... I guess getting old, nearly blind and mind numbing close to brain dead is better than the alternative. Try this (sooner or later I've got to get it right)... perl -pe 's/(.*?)\.(.*)\t.*/$1_$2\@example.com/' input_file > output_file Sorrier. -- Walter M. Pawley Wump Research & Company 676 River Bend Road, Roseburg, OR 97470 541-672-8975