Sha256: 6eba759989c475c588925df1cedcba975a3109bd1b3d7fbf38e338bac9a9d408
Contents?: true
Size: 447 Bytes
Versions: 19
Compression:
Stored size: 447 Bytes
Contents
#!/usr/bin/env ruby require 'csv' require 'shellwords' prev_row = nil begin CSV.open(ARGV[0], 'rb').each { |row| prev_row = row } rescue CSV::MalformedCSVError => e puts e.class.to_s + ': ' + e.message puts "previous row was #{prev_row}" if e.message =~ /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
19 entries across 19 versions & 1 rubygems