title: Read in the last n lines of a csv file using a BufferedReader
body: <p>I have a program that reads in the first and last lines of a CSV file using a <code>BufferedReader</code> and now I need to convert this to read the first and <strong>last 8</strong> lines of the file, since the format has changed. But I'm not sure how denote the last 8 lines.</p>
  
  <p>How(can I) would I denote the last 8 lines of a file using a <code>BufferedReader</code></p>
  
  <pre><code>try(BufferedReader reader = new BufferedReader(
          new InputStreamReader(
                  response.getEntity().getContent()))) {
  
       if(reader != null){
           String aux = "";
           String lastLineMinusOne = "";
           while ((aux = reader.readLine()) != null) {
               String auxTrimmed = aux.replaceAll("(?m)^[ \t]*\r?\n", "");
               if(count == 0)firstLine = auxTrimmed;
               lastLineMinusOne = lastLine;
               lastLine = auxTrimmed;
               count ++;
          }
          logger.info("Count = " + count); 
          columns = firstLine.split(",");
  
          data = lastLine.split(","); 
  </code></pre>