aboutsummaryrefslogtreecommitdiff
path: root/cr-test.cr
blob: 18c6580ef99ae30ee635c991fd1d8f19e82e24ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# build: crystal build --release cr-test.cr

require "csv"

# get paths
src_path, dst_path = ARGV

File.open(src_path, "rb") do |src_io|
  File.open(dst_path, "wb") do |dst_io|
    CSV.build(dst_io) do |dst|
      CSV.each_row(src_io) do |row|
        dst.row(row += (%w{foo} * 2))
      end
    end
  end
end