Created
October 1, 2015 05:50
-
-
Save kangkyu/0a3ed66bda887e307e74 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
result_hash = Hash.new([0, ""]) | |
File.read("path/to/file").each_line do |line| # something like that | |
line.each do |column_name, value| # a line is not an hash or nested array, but could possibly convert somehow | |
if result_hash[column_name][0] < value.length | |
result_hash[column_name][0] = value.length | |
result_hash[column_name][1] = line[factual_id] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment