From 73bce6b2090b501cd9e2fa20ec1e22ea291bb177 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 31 Aug 2016 17:22:57 -0400 Subject: commit outstanding changes --- py-test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 py-test.py (limited to 'py-test.py') 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)) -- cgit v1.2.3