[Gllug] strip invalid email addresses

Progga proggaprogga at gmail.com
Fri Dec 7 17:52:20 UTC 2007


On Fri, Dec 07, 2007 at 05:21:46PM +0000, countd wrote:

> I have a plain text list of email addresses. Can anyone help me with a
> one liner (sed?) to strip out the invalid ones? I can see for example
> that there are telephone numbers in there, and lines with no @ sign
> which I'd like to get rid of.

Assuming that each line contains only one address/phone-number/... 

$ cat list.txt | sed -n "/@.*/p"

  will filter the email addresses.  You'll have to tweak the regex for best
performance.  You can google for the perfect regex for email address.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20071207/00774487/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list