aboutsummaryrefslogtreecommitdiff
path: root/cr-test.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-31 17:22:57 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-31 17:22:57 -0400
commit73bce6b2090b501cd9e2fa20ec1e22ea291bb177 (patch)
tree9723e326a7600b96ee0757de92ff5baa9fdd260d /cr-test.cr
parent199d786cb4accd50375164d1f65336bb08441092 (diff)
downloadcsv-test-73bce6b2090b501cd9e2fa20ec1e22ea291bb177.tar.bz2
csv-test-73bce6b2090b501cd9e2fa20ec1e22ea291bb177.zip
commit outstanding changes
Diffstat (limited to 'cr-test.cr')
-rw-r--r--cr-test.cr16
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