Sed to extract email addresses from file
sed -e "s/^.\*<\(.*\)>.*$/\1/" /file_with_emails | sort | \\ uniq | tr "[:upper:]" "[:lower:]" PS: Filip, he’s terribly smart, I guess the only one to read my blog, pointed out the following one-liner:
sed -nr "s/.*<([A-Z0-9._%-+]+@[A-Z0-9.-]+\.[A-Z]{2,4})>.*/\L\1/pi" \\ file_with_emails | sort -u Comments: Filip - Jun 4, 2012Hi. This one does the lowercase conversion immediately and lists only e-mails in a valid format.
sed -nr "s/.*.*/\L\1/pi" file_with_emails | sort -u Filip - Jun 4, 2012Sorry, WP isn’t friend of my sed oneliner.
[Read More]