Register
It is currently Sun Dec 21, 2014 4:59 am

mail filtring


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Feb 02, 2012 7:59 am   

Joined: Wed Jan 25, 2012 1:32 pm
Posts: 5
hi everyone :)
i have a list of mails as:
hbiy@yv.iu
yvvvvuywe@ub.ih
9685@
gmail
«‘“¥‘~‹@rij
lurebh@ub.lp

i want filter it into
hbiy@yv.iu
yvvvvuywe@ub.ih
lurebh@ub.lp

so i used grep, but it doesn't work at all :(
this work a few:
grep @ < "$output" | cat >> temp1.txt
grep -v ^@ < temp1.txt | cat >> temp2.txt
grep -v ^* < temp2.txt | cat >> address.txt
but not for all [:punct:] except @ and .

i tried using
grep [qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM1234567890] < temp1.txt | cat >> temp2.txt
grep [$tTmM] < temp2.txt | cat >> address.txt #this for .it and .com [i'm italian xD]
and a lot of variants, but i don't understand how use propely regular expression, can you help me?

final script have data from $output and after fitring them must add(cause it's recursive) them to address.txt

i'll post this script when it will be finished so you can suggest me other things ^^


Top
 Profile  
 PostPosted: Thu Feb 02, 2012 12:25 pm   

Joined: Wed Jan 25, 2012 1:32 pm
Posts: 5
SOLVED :)
Code:
man=$(grep "^[a-zA-Z0-9]" address2.txt)
girl=$(echo "$man" | grep @)
son=$(echo "$girl" | grep "$[a-zA-Z]")

echo "$son"


Top
 Profile  
 PostPosted: Sat Feb 04, 2012 9:03 am   
User avatar

Joined: Wed Jun 08, 2011 8:27 am
Posts: 189
Location: outer Shpongolia
Perhaps it suffices for your purpose:

Code:
sed '/@.*\./!d' < "$output" > address.txt


Not safe, though.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP