title: insert new row after each 10 items in apache poi
body: <p>I have a <code>List&lt;String&gt;</code> that has few elements and I want to write these elements into an Excel sheet using Apache POI. Also I want to put the data into separate rows after each 10 items.  For example, my list has following elements : </p>
  
  <pre><code>["aaa","bbb","ccc","ddd","eee","fff","ggg","hhh","iii","jjj","kkk","lll","mmm","nnn","ooo","ppp","qqq","rrr","sss","ttt",....]
  </code></pre>
  
  <p>I want this in excel sheet in following format</p>
  
  <pre><code>        col1, col2, col3, col4, col5, col6, col7, col8, col9, col10
  row1 :  aaa,  bbb,  ccc,  ddd,  eee,  fff,  ggg,  hhh,  iii,  jjj
  row2 :  kkk,  lll,  mmm,  nnn,  ooo,  ppp,  qqq,  rrr,  sss,  ttt
  </code></pre>
  
  <p>Can this be achieved through Apache POI?</p>
  
  <p>I have tried the following (I am really bad in loops)</p>
  
  <pre><code>public void csvUpdateWorksheet1(String fileName, String sheetName, List&lt;String&gt; data) {
  
      HSSFWorkbook workbook = new HSSFWorkbook();
      HSSFSheet sheet = workbook.createSheet(sheetName);
  
      logger.info(data.size());
      int rownum = 0;
      for (int i = 0; i &lt; data.size(); i++) {
          Row row = sheet.createRow(i);
          Cell cell = row.createCell(i);
          cell.setCellValue(data.get(i));    
      }        
      csvWriteToFile(workbook, fileName);            
  }
  </code></pre>