Sha256: 2bdbd91b07a62123e48e030d4031b40dc28dc384256f0f5aba5b8ef70d9b1350

Contents?: true

Size: 399 Bytes

Versions: 2

Compression:

Stored size: 399 Bytes

Contents

#!/usr/bin/env ruby

require 'csv'
require 'shellwords'

begin
  CSV.open(ARGV[0], 'rb').each { }
rescue CSV::MalformedCSVError => e
  puts e.class.to_s + ': ' + e.message
  if e.message =~ /Missing or stray quote in line (\d+)/
    lineno = $1.to_i
    cmd = "csv-readline #{Shellwords.escape(ARGV[0])} #{lineno}"
    puts "running #{cmd}"
    system(cmd)
  end
  exit 1
end

puts 'CSV file is ok'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
csv-utils-0.1.2 bin/csv-find-error
csv-utils-0.1.1 bin/csv-find-error