Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv, exit
- import csv
- import re
- if len(argv) < 2:
- print("mising command-line argument")
- exit(1)
- pattern = "name"
- with open(argv[1], newline = '') as csvfile:
- print("using reader()")
- myreader = csv.reader(csvfile, delimiter = ' ')
- for row in myreader:
- if (row == "name"):
- print("using DictReader()")
- dicread = csv.DictReader(csvfile)
- for row in dicread:
- print(row['rowi'], row['rowj'])
Advertisement
Add Comment
Please, Sign In to add comment