Skip to content

Instantly share code, notes, and snippets.

@worace
Created September 20, 2022 18:52
Show Gist options
  • Select an option

  • Save worace/e8051936db83799f372f23c2c3f5f6b9 to your computer and use it in GitHub Desktop.

Select an option

Save worace/e8051936db83799f372f23c2c3f5f6b9 to your computer and use it in GitHub Desktop.

Revisions

  1. worace created this gist Sep 20, 2022.
    3 changes: 3 additions & 0 deletions csv2json.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    csv2json () {
    ruby -r csv -r json -e 'CSV.new(STDIN, headers: true).each { |r| puts r.to_h.to_json }'
    }