Last active
December 14, 2015 15:58
-
-
Save bobbrez/5111532 to your computer and use it in GitHub Desktop.
Simple script to read json and output a table.
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'terminal-table' | |
require 'json' | |
require 'hashie' | |
require 'csv' | |
data = Hashie::Mash.new JSON.parse(ARGF.read) | |
CSV.open('uvr.csv', 'w') do |csv| | |
csv << ['oid', 'uvr'] | |
data.response.data.orgs.each_value do |val| | |
csv << [val.oid, val.uvr] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment