python - Can I use a Dictionary to store keywords that I need to loop through a csv file to find? -
i writing python script go through csv file row row looking keyword. once keyword found need write entire row new .csv file. having trouble writing loop complete task , not understand how write new .csv file. post have done far below. #!/usr/bin/python # first import csv module work on .csv file import csv #lets open files used read , write infile = open('infile.csv','rb') outfile = open('outfile.csv','w') # lets pass file object through csv reader method csv_f_reader = csv.reader(infile) writer = csv.writer(outfile,delimiter=',',quotechar='',quoting=csv.quote_none) #lets create dictionary hold search words unique keys. # associated value used keep count of how many successful # hits forloop hits. search_word={'wifi':0,'wifi':0,'wi-fi':0,'wi-fi':0,'cisco':0,'cisco':0,'netgear':0,'netgear':0,'netge$ csv_line in csv_f_reader: match_found = false keyword ...