Extract uniq emails sorted by domain from file.
Note that we ignore emails of the form xxx@yyy.com, i.e. if it has a '<' we ignore it.
$ extract_emails.zsh file_with_emails.txt
example@example.com
ex@ex.com
...
Extract uniq emails sorted by domain from file.
Note that we ignore emails of the form xxx@yyy.com, i.e. if it has a '<' we ignore it.
$ extract_emails.zsh file_with_emails.txt
example@example.com
ex@ex.com
...
# Extract uniq emails sorted by domain from file. | |
# Note that we ignore emails of the form <xxx@yyy.com>, i.e. if it has a '<' we ignore it. | |
awk '{ | |
for (i=1;i<=NF;i++) { | |
if ( $i ~ /[[:alpha:]]@[[:alpha:]]/ ) { | |
print $i | |
} | |
} | |
}' $1 | sort | uniq | grep -v '<' | sort -t@ -k2 -r |