Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Tim Watts Newsgroups: comp.os.linux.misc Subject: Re: Script to parse a text file and extract unique email addresses Date: Thu, 21 Aug 2014 10:53:07 +0100 Lines: 12 Message-ID: <35sgcb-5v7.ln1@squidward.local.dionic.net> References: <87zjf0qklx.fsf@usenet.ankman.de> <87f49cf7-724b-4235-b466-082dac8287e9@googlegroups.com> <874mx6ol11.fsf@usenet.ankman.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net YmdD/JtWl1neU8m2eJyJSgPypgN6HAhyiAoGRSBXlIAlSvvWB4 X-Orig-Path: squidward.local.dionic.net!not-for-mail Cancel-Lock: sha1:MTy4l4HKL2kQ7dnJ7vBdnLrtW9c= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <874mx6ol11.fsf@usenet.ankman.de> Xref: csiph.com comp.os.linux.misc:11771 On 20/08/14 23:26, Andreas Kohlbach wrote: > Try > > grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b"|sed -e 's/^//' > > to extract from the file. > You need to include + and _ in the local part as well - a very common component.