Created
September 30, 2019 14:54
-
-
Save gr33n7007h/794b51b16515d8c2e1ec11e93b9c4236 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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