Sha256: 8133ffb63acd31ea302214eed2e159d3ac6a1fc7eec7a199db85a4efd3f1bb08
Contents?: true
Size: 336 Bytes
Versions: 26
Compression:
Stored size: 336 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'json' require 'csv' STDIN.each_line do |line| CSV.parse(line.force_encoding("iso-8859-1").encode("utf-8")) do |row| object = {} row.size.times do |column| key = ARGV[column] || "column-#{column}" object[key] = row[column] end puts object.to_json end end
Version data entries
26 entries across 26 versions & 1 rubygems