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

next in thread | previous in thread | raw e-mail | index | archive | help
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 )

  - barry




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