Created
February 17, 2011 09:07
-
-
Save dotemacs/831351 to your computer and use it in GitHub Desktop.
Sometimes I just want contact info in plain text :)
This file contains hidden or 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/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