diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-08-31 17:22:57 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-08-31 17:22:57 -0400 |
commit | 73bce6b2090b501cd9e2fa20ec1e22ea291bb177 (patch) | |
tree | 9723e326a7600b96ee0757de92ff5baa9fdd260d /py-test.py | |
parent | 199d786cb4accd50375164d1f65336bb08441092 (diff) | |
download | csv-test-73bce6b2090b501cd9e2fa20ec1e22ea291bb177.tar.bz2 csv-test-73bce6b2090b501cd9e2fa20ec1e22ea291bb177.zip |
commit outstanding changes
Diffstat (limited to 'py-test.py')
-rw-r--r-- | py-test.py | 16 |
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)) |