a guest Sep 23rd, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- require 'yaml'
- structure = 
- key = ''
- File.open(ARGV, 'r').each_line.with_index do |lines, index|
- data = lines.chomp.split("\t")
- key << data if index.zero?
- structure << Hash[key.zip(data)] if index > 0
- File.open(ARGV, 'w') do |file|
- file.puts structure.to_yaml if ARGV
- print structure.to_yaml
RAW Paste Data