Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created September 30, 2019 14:54
require 'yaml'
t = %i(name address tel fax email website).freeze
c = []
File.read('data.txt').split("\n\n").each do |line|
c << t.zip(line.split("\n")).to_h
end
puts c.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment