ktl014
7/27/2017 - 5:54 PM

how to filter from csv file using python From https://stackoverflow.com/questions/10530301/how-to-filter-from-csv-file-using-python-script

import csv
with open('infile','r'), open ('outfile','w') as fin, fout:
    writer = csv.writer(fout, delimiter=' ')            
    for row in csv.reader(fin, delimiter=' '):
        if row[2] == 'Central':
             writer.writerow(row)