Sha256: 9298f610ca72ba601ca1e6fae8c2f475bd01c969ca6efe7ed2e57c970c4f7b33
Contents?: true
Size: 548 Bytes
Versions: 1
Compression:
Stored size: 548 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) if row row = row.map(&:strip) emit(row) end end end @output.close if opts[:output] { :input_count => input_count, :output_count => @output_count } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
masticate-0.2.2 | lib/masticate/csvify.rb |