Grepping emails
And people wonder why I love Unix/Bash. I had to combine a few different files yesterday that had email addresses, but with different delimiters and a bunch of dupes. This basically goes through those files, standardizes the delimiters, sorts it in a fashion to get find the emails with the most info, uniq’s out the dupes, and then reorders it into a csv file.
Schwag.
sed 's/:/,/g' Email\ List.txt | tr -d "'" | sort -r | awk -F, '{print $2"\t__"$3"\t__"$1}' | sed 's/^[ ^t]*//;s/[ ^]*$//’ | uniq -f2 | tr -d “__” | sort | tr “\t” “,” > Emails.csv
No Comments so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>