Help on this code

My code (below) is searching the entire field in column 3 for the brand, if it finds the exact match, it prints the row.

I want it to print the row if it CONTAINS the word anywhere in column 3. How would I edit this to make it work?

brand = []
with open (r'C:\python_files\ez1.csv', 'r') as f:
    # skip first line
    f.readline()
    for line in f:
        brand.append(line.strip("\n"))

with open (r'C:\python_files\ez2.csv', 'r') as f:
        # skip the first line
        f.readline()
        for line in f:
            if (line.split(",")[2]) in brand:
                print (line),

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.