How to get line count in a file without reading
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6101367/how-to-count-lines-fast">How to count lines fast?</a>  </p>
</blockquote>



<p>I have some files that contains data line by line.</p>

<p>I want to get the line count in a file to show progress state to user. 
(I process these files in background reading line by line)</p>

<p>I can do this by reading the file completely, but these files are so big that
my application unnecessarily consumes RAM space.</p>

<p>So I want to get line count in a file without reading the whole file.</p>

<p>How can I do this?</p>
