Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Aug 2008 08:56:34 -0400
From:      Steve Bertrand <steve@ibctech.ca>
To:        Barry Byrne <barry.byrne@wbtsystems.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: sed/awk, instead of Perl
Message-ID:  <48AD6602.1050504@ibctech.ca>
In-Reply-To: <20080821135259.156611o45aw86x4g@webmail.wbtsystems.com>
References:  <48AD63B7.8090107@ibctech.ca> <20080821135259.156611o45aw86x4g@webmail.wbtsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Barry Byrne wrote:
> Quoting "Steve Bertrand" <steve@ibctech.ca>:
> 
>  few passes over a few files.
>>
>> To put it plainly, can anyone, if it's possible, provide a single line 
>> sed/awk pipeline that can:
>>
>> - 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
>>
>> Regards,
> 
> cat file.txt | ( while read user domain; do echo "$user@$domain"; done )

Thanks, but I don't think I was overly clear in my OP.

- the domain needs to change from domain.tld to example.com

- the user.name needs to be modified to user_name

Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48AD6602.1050504>