in reply to Searching for Patterns in CSV

It would help if you could post the exact Python code you're using instead of mixing Perl and Python. Also include a few lines of your input, preferably at least one that matches your if() and another one that doesn't.

-stevieb