diff options
Diffstat (limited to 'cr-test.cr')
-rw-r--r-- | cr-test.cr | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cr-test.cr b/cr-test.cr new file mode 100644 index 0000000..18c6580 --- /dev/null +++ b/cr-test.cr @@ -0,0 +1,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 |