Skip to content

Instantly share code, notes, and snippets.

@sbmsr
Created May 26, 2022 21:53
Show Gist options
  • Save sbmsr/0ba127d837d3dd0b68025cb688963287 to your computer and use it in GitHub Desktop.
Save sbmsr/0ba127d837d3dd0b68025cb688963287 to your computer and use it in GitHub Desktop.
Turn CSV into JSON
cat my.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment