Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Created March 23, 2012 14:10
Show Gist options
  • Save wrburgess/2170970 to your computer and use it in GitHub Desktop.
Save wrburgess/2170970 to your computer and use it in GitHub Desktop.
Parse json to csv in ruby
require 'csv'
require 'json'
csv_string = CSV.generate do |csv|
JSON.parse(File.open("filename.json").read).each do |hash|
data = hash[1]
theline = theline + " #{data},"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment