aboutsummaryrefslogtreecommitdiff
path: root/py-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'py-test.py')
-rw-r--r--py-test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/py-test.py b/py-test.py
new file mode 100644
index 0000000..0662965
--- /dev/null
+++ b/py-test.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python2.7
+
+import sys
+import csv
+
+with open(sys.argv[1], 'rb') as src_file:
+ # create csv reader
+ src = csv.reader(src_file)
+
+ with open(sys.argv[2], 'wb') as dst_file:
+ # create csv writer
+ dst = csv.writer(dst_file)
+
+ # walk, mutate, and write rows
+ for row in src:
+ dst.writerow(row + (['foo'] * 2))