Skip to content

Instantly share code, notes, and snippets.

@dotemacs
Created February 17, 2011 09:07
Show Gist options
  • Select an option

  • Save dotemacs/831351 to your computer and use it in GitHub Desktop.

Select an option

Save dotemacs/831351 to your computer and use it in GitHub Desktop.
Sometimes I just want contact info in plain text :)
#!/usr/bin/env ruby
# spit out a VCARD, stripping all the 'fluff'
if ARGV.length == 0
puts "supply a file"
exit 1
else
file = ARGV[0]
end
File.open(file).each { |line|
puts line.gsub(/.*:/, "") if line =~ /(fn|tel|email)/i
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment