Created
September 18, 2012 16:03
-
-
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 -
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/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