Created
October 29, 2015 23:52
-
-
Save bpo/a3ed23da181d6954e429 to your computer and use it in GitHub Desktop.
strip a document of formatted address lists and names down to just the email addresses themselves
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
require 'mail' | |
$stdin.each_line do |line| | |
addresses = Mail::AddressList.new(line.chomp) | |
addresses.addresses.each do |a| | |
puts a.address | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment