Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- param, template = ARGV
- params = nil
- open(param) do |f|
- keys = f.gets.split
- params = f.map {|line| keys.zip(line.split).to_h }
- end
- templ = open(template).gets
- params.each {|prms| puts templ.gsub(/\$\d+/, prms) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement