Date: Thu, 21 Aug 2008 09:02:17 -0400 From: Steve Bertrand <steve@ibctech.ca> To: Joseph Olatt <joji@eskimo.com> Cc: freebsd-questions@freebsd.org Subject: Re: sed/awk, instead of Perl Message-ID: <48AD6759.5030506@ibctech.ca> In-Reply-To: <20080821055429.A26910@eskimo.com> References: <48AD63B7.8090107@ibctech.ca> <20080821055429.A26910@eskimo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Joseph Olatt wrote: > 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 This did the job, the only modification I needed to make was manually replace $2 with the string of the domain I needed it changed to. Fantastic! Thanks everyone for such quick responses! Steve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48AD6759.5030506>