Convert a CSV (comma-separated value) file into JSON.
csv2json.py data.csv > data.json
#!/usr/bin/env python
import sys
import csv
import json
if len(sys.argv) < 2: raise SystemExit
reader = csv.DictReader(open(sys.argv[1]))
print json.dumps([row for row in reader], indent=2)