Skip to content

Instantly share code, notes, and snippets.

@AlexTalker
Created March 26, 2014 21:43
Show Gist options
  • Select an option

  • Save AlexTalker/9794317 to your computer and use it in GitHub Desktop.

Select an option

Save AlexTalker/9794317 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'vcardigan'
file = File.open('telephons.txt', 'a')
ARGV.each {|i|
f = File.read(i)
vcard = VCardigan.parse(f)
tlf = vcard.tlf.first.value
puts tlf
tlf.gsub!(/\D/, '')
puts tlf
file.puts(tlf)
}
file.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment