Extract uniq emails sorted by domain from file.
Note that we ignore emails of the form [email protected], i.e. if it has a '<' we ignore it.
$ extract_emails.zsh file_with_emails.txt
[email protected]
[email protected]
...
Extract uniq emails sorted by domain from file.
Note that we ignore emails of the form [email protected], i.e. if it has a '<' we ignore it.
$ extract_emails.zsh file_with_emails.txt
[email protected]
[email protected]
...
| # Extract uniq emails sorted by domain from file. | |
| # Note that we ignore emails of the form <[email protected]>, 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 |