No need for csv specific code, fileinput doesn't care what kind of file it is and finds the lines just fine.  Tested and confirmed working.