4 select_column = sys.argv[1]
5 select_values = sys.argv[2]
9 sv = open(select_values, "rt")
10 selectvals = [s.strip() for s in sv]
12 print("selectvals", selectvals)
14 ds = csv.reader(open(dataset, "rt"))
16 print("header is", header)
18 for i,v in enumerate(header):
19 if v == select_column:
21 if columnindex is None:
22 raise Exception("Column %s not found" % select_column)
24 print("column index", columnindex)
26 ex = csv.writer(open("extracted.csv", "wt"))
27 ex.writerow(["cluster"]+list(header))
30 if row[columnindex] in selectvals:
31 ex.writerow([cluster]+list(row))