Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (11 sloc) 548 Bytes
# encoding: UTF-8
#Reemplaza todas las tildes de un fichero dado y escribir el resultado en otro
map = {'á' => 'á','é' => 'é','í' =>'í' ,'ó' => 'ó','ú' => 'ú','Á' => 'Á','É' => 'É','Í' => 'Í','Ó' => 'Ó','Ú' => 'Ú', 'ñ' => 'ñ', 'Ñ' => 'Ñ'}
lines = File.open(ARGV[0]).readlines
lines.each do |line|
cleanLine = line
map.each do |k,v|
cleanLine = cleanLine.gsub(k,v);
end
File.open(ARGV[1], "a") {|f| f << cleanLine.to_s}
end