count rows in a text file
<p>I have the following rows in a text file and I need to know how many rows end with a Y and how many end with a N.</p>

<p>there is a space after the Y and after the N.</p>

<p>The faster the better as it might contain a million or so rows.(so I would prefer not to loop through every line)</p>
