title: Excel cannot understand the format of data written by java
body: <p>I am having 2 issues using the apache POI to write data from a csv into an excel file.
  The data consists of dates, and numbers
  The issues are:</p>
  
  <pre><code>1) The numbers are written as strings.
  2) Excel cannot read the date format (this messes the graphs up)
  </code></pre>
  
  <p>The code (that I received help with previously):</p>
  
  <pre><code>    String name = "test";
      Sheet sheet = wb.getSheet(name);
      if (sheet == null) {
          sheet = wb.createSheet(name);
      }
  
      int rowCount = 0;
      Scanner scanner = new Scanner(new File("/tmp/" + name + ".csv"));
      while (scanner.hasNextLine()) {
          String[] rowData = scanner.nextLine().split(",");
          for (int col = 0; col &lt; rowData.length; col++) {
              Row row = sheet.getRow(rowCount);
              if (row == null)
                  row = sheet.createRow(rowCount);
              Cell cell = row.getCell(col);
              if (cell == null) {
                  cell = row.createCell(col);
              }
              cell.setCellValue(rowData[col]);
          }
          rowCount++;
      }
  
      wb.write(new FileOutputStream(excel));
  }
  </code></pre>
  
  <p>1) I tried using <code>Double.parseDouble(rowData[col])</code> when entering the data into the excel file. but this gives an empty string error. I even set the cell format with <code>style.setDataFormat(format.getFormat("#,##0.0000"));</code> but it still does not work</p>
  
  <p>2) I tried using the date format  <code>cellStyle.setDataFormat(createHelper.createDataFormat().getFormat("m/d/yyyy hh:mm:ss"));</code> but still the excel graphs can't read this format. (when I manually copy and paste from the csv file it works).</p>
  
  <p>So basically, when copying data using the apache poi, none of the other data that relies on the copied cells is updated. 
  for example if a cell has a value of the average of 100 cells, and I manually copy data into those cells, it updates automatically. But when it copies through java, the cells do not update.</p>