Sha256: 5b4e64055226a893609ead39fe611705d56d9f874103fab2d2867b9626396f23
Contents?: true
Size: 500 Bytes
Versions: 6
Compression:
Stored size: 500 Bytes
Contents
# convert input to clean standard CSV require "csv" class Masticate::Csvify < Masticate::Base def initialize(filename) @filename = filename end def csvify(opts) standard_options(opts) @output_count = 0 with_input do |input| while line = get row = CSV.parse_line(line, csv_options) emit(row.to_csv) if row end end @output.close if opts[:output] { :input_count => input_count, :output_count => @output_count } end end
Version data entries
6 entries across 6 versions & 1 rubygems