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.27 bin/ix-csv-to-json
ix-cli-0.0.26 bin/ix-csv-to-json
ix-cli-0.0.25 bin/ix-csv-to-json
ix-cli-0.0.24 bin/ix-csv-to-json
ix-cli-0.0.23 bin/ix-csv-to-json
ix-cli-0.0.22 bin/ix-csv-to-json
ix-cli-0.0.21 bin/ix-csv-to-json
ix-cli-0.0.20 bin/ix-csv-to-json
ix-cli-0.0.19 bin/ix-csv-to-json
ix-cli-0.0.18 bin/ix-csv-to-json
ix-cli-0.0.17 bin/ix-csv-to-json
ix-cli-0.0.16 bin/ix-csv-to-json
ix-cli-0.0.15 bin/ix-csv-to-json
ix-cli-0.0.14 bin/ix-csv-to-json
ix-cli-0.0.13 bin/ix-csv-to-json
ix-cli-0.0.12 bin/ix-csv-to-json
ix-cli-0.0.11 bin/ix-csv-to-json
ix-cli-0.0.10 bin/ix-csv-to-json
ix-cli-0.0.9 bin/ix-csv-to-json
ix-cli-0.0.7 bin/ix-csv-to-json