Last active
November 7, 2017 16:36
-
-
Save cluther/a28116631f4fb9ddabe4e4f1c790b8fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Example of using Python's csv module. | |
# | |
# Usage: | |
# | |
# python csv-example.py < input.csv | |
import csv | |
import sys | |
reader = csv.reader(sys.stdin) | |
writer = csv.writer(sys.stdout) | |
for inrow in reader: | |
outcol1 = "".join(inrow[0:3]) | |
outcol2 = inrow[3] | |
writer.writerow([outcol1, outcol2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment