Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piyushranjan/521e0b62b7d861b1e504e62ee33576a1 to your computer and use it in GitHub Desktop.
Save piyushranjan/521e0b62b7d861b1e504e62ee33576a1 to your computer and use it in GitHub Desktop.
require "json"
require "csv"
csv_file = File.open("processedcr.csv", "w")
CSV.build(csv_file) do |csv|
Dir.foreach("resale"){|f|
file = File.join("resale", f)
next unless File.file?(file)
next if File.size(file) == 0
json_str = File.read(file)
begin
puts file
json = JSON.parse(json_str.to_s)
rescue
next
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment