title: Reading N lines from a file in java?
body: <p>I am not quite sure how to explain my question but I will try my best. Say for example, I have a file containing 100 numbers, is it possible to read lines 25-50 from this 100 numbers file.</p>
  
  <p>To read N amount from begining, I would do something like this;</p>
  
  <pre><code>ArrayList&lt;Double&gt; array = new ArrayList&lt;Double&gt;();
   Scanner input = new Scanner(new File("numbers.txt"));
   int counter = 0;
   while(input.hasNextLine() &amp;&amp; counter &lt; 10)
   {
       array.add(Double.parseDouble(input.nextLine()));
       counter++;
   }
  </code></pre>
  
  <p>But I am not quite sure how I can go about start reading from a given line e.g. lines 25-50 or  25-75 or 75-100 etc.</p>
  
  <p>Any help is much appreciated and please let me know if my question is not clear.</p>
  
  <p>edit:</p>
  
  <p>Some data in the file:</p>
  
  <ul>
  <li>1.45347,1.1545,1.2405</li>
  <li>1.467,1.4554,1.2233</li>
  <li>1.4728,1.3299,1.1532</li>
  <li>1.131,1.5139,1.0044</li>
  <li>1.4614,1.7373,1.6235</li>
  <li>1.654,1.5544,1.61147</li>
  </ul>