sed/awk, instead of Perl
Steve Bertrand
steve at ibctech.ca
Thu Aug 21 12:55:09 UTC 2008
Barry Byrne wrote:
> Quoting "Steve Bertrand" <steve at 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 at 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
More information about the freebsd-questions
mailing list