title: what is the fastest way to get dimensions of a csv file in java
body: <p>My regular procedure when coming to the task on getting dimensions of a csv file as following:</p>
  
  <ol>
  <li>Get how many rows it has:</li>
  </ol>
  
  <p>I use a while loop to read every lines and count up through each successful read. The cons is that it takes time to read the whole file just to count how many rows it has.</p>
  
  <ol start="2">
  <li>then get how many columns it has:
  I use <code>String[] temp = lineOfText.split(",");</code> and then take the size of temp.</li>
  </ol>
  
  <p>Is there any smarter method? Like: <br>
  file1 = read.csv; <br>
  xDimention = file1.xDimention;<br>
  yDimention = file1.yDimention;</p>