Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created September 18, 2012 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fakenickels/3743932 to your computer and use it in GitHub Desktop.
Save fakenickels/3743932 to your computer and use it in GitHub Desktop.
Pega um arquivo de texto, e cria um novo arquivo de texto retirando todas as vogais e trocando-as por -
#!/usr/bin/ruby
# Troca vogais e coloca um hifen no lugar das mesmas
# passe como argumento o arquivo de texto i.e. ->
# matavogais.rb /home/masterboss/vogais.txt
File.open("#{File.dirname(ARGV[0])}/noVogals.txt",'w') do |f|
f << File.read( ARGV[0] ).gsub(/[aeiou]/i, '-')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment