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

Version Path
ix-cli-0.0.6 bin/ix-csv-to-json
ix-cli-0.0.5 bin/ix-csv-to-json
ix-cli-0.0.4 bin/ix-csv-to-json
ix-cli-0.0.3 bin/ix-csv-to-json
ix-cli-0.0.2 bin/ix-csv-to-json
ix-cli-0.0.1 bin/ix-csv-to-json