I\'ve got a large flat file of usernames and emails in the following format:
\"username\", \"email\"
\"username\", \"email\"
\"username\", \"email\"
<
I truly believe that all examples in other answers works!
But all they are slow, because all of them travers each line in csv file...
I have another example how to find desired string:
$command = sprintf("grep '%s,%s' -Er %s", $userName, $email, $file);
$result = `$command`;
Yes it some kind of dark matter, but it really works and it really fast!