-
-
Save Orbyt/3e798b6a29a9675e430febbe273a467b 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 'json' | |
arr = Array.new | |
File.readlines('./hello.txt').each do |line| | |
arr << line | |
end | |
res = arr.map { |e| | |
{data: e} | |
} | |
puts res.to_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment