Skip to content

Instantly share code, notes, and snippets.

@parth-paradkar
Created February 5, 2021 16:27
Show Gist options
  • Select an option

  • Save parth-paradkar/80a53b829ef8cbd57882c67dcd00a240 to your computer and use it in GitHub Desktop.

Select an option

Save parth-paradkar/80a53b829ef8cbd57882c67dcd00a240 to your computer and use it in GitHub Desktop.

Revisions

  1. parth-paradkar created this gist Feb 5, 2021.
    9 changes: 9 additions & 0 deletions csv_to_json_header.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    from sys import argv
    import csv
    import json

    with open(argv[1], 'r') as csv_file:
    reader = csv.DictReader(csv_file)
    data = [d for d in reader]
    with open("result.json", 'w') as f:
    json.dump(data, f)