title: Read excel and Assign cell Value by column to an array
body: <p>Using apache.poi, I am trying to read an Excel sheet and using the below code, I am printing all the values inside Excel..</p>
  
  <pre><code>  for (int i = 0; i &lt; rowCount + 1; i++) {
          Row row = searcsheet.getRow(i);
  
          // Create a loop to print cell values in a row
          for (int j = 0; j &lt; row.getLastCellNum(); j++) {
              // Print Excel data in console
              String location = (row.getCell(j).getStringCellValue()+ "");
              System.out.println(location);
          }
  </code></pre>
  
  <p>When I print the location <code>System.out.println(location);</code>, it prints my all Excel sheet data. I haven't any control over there. I am trying divide the value by the column.</p>
  
  <p>Suppose I have 3 cells and I want to get a value like <code>firstname[],lastname[],age[]</code> so that I can do any operation by the indexing. I am not getting any solution.</p>
  
  <p><a href="https://i.stack.imgur.com/7pEG3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7pEG3.png" alt="enter image description here"></a></p>
  
  <p>Here is my full code
  <a href="https://codeshare.io/anNwy3" rel="nofollow noreferrer">https://codeshare.io/anNwy3</a></p>