Skip to content

Instantly share code, notes, and snippets.

@prodis
Created March 6, 2011 15:53
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 prodis/857368 to your computer and use it in GitHub Desktop.
Save prodis/857368 to your computer and use it in GitHub Desktop.
Script para gerar arquivo YAML de ramos de atividade
# encoding: utf-8
# ramos_de_atividade.rb
nomes = File.readlines("ramos_de_atividade.txt")
File.open("ramos_de_atividade.yaml", "w") do |f|
nomes.each_with_index do |nome, i|
f.puts "ramo_de_atividade_#{i+1}"
f.puts " id: #{i+1}"
f.puts " nome: #{nome}\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment