Created
August 14, 2017 23:06
-
-
Save adamf/d0afdc7224e33ce156781c216be13787 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import csv | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--field', help='field number to output') | |
parser.add_argument('--filename', help='filename to parse') | |
args = parser.parse_args() | |
with open(args.filename) as csvfile: | |
fields = csv.reader(csvfile) | |
for row in fields: | |
print(row[int(args.field)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment