Skip to content

Instantly share code, notes, and snippets.

@dacc
Created October 19, 2011 03:57
Show Gist options
  • Save dacc/1297445 to your computer and use it in GitHub Desktop.
Save dacc/1297445 to your computer and use it in GitHub Desktop.
import os, json, csv
os.chdir("/Users/dcarleton/workspace/upload")
jsons = filter(lambda f: f.endswith(".json"), os.listdir("."))
for file in jsons:
j = json.load(open(file))
csv_file = open(file + ".csv", "w")
c = csv.writer(csv_file)
for r in j:
c.writerow(r.values())
csv_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment