0

I've seen this post and it's work. But the percent is not converted.

Ex : In the xls, C1 = 0,0226115615112098% After the convertion, in the CSV, C1 = ?0.2f%

I don't find how specify the good format in this case.

enter image description here

The post example is :

require_once 'Classes/PHPExcel/IOFactory.php';

$inputFileType = 'Excel5';
$inputFileName = 'YOUR_EXCEL_FILE_PATH';

$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcelReader = $objReader->load($inputFileName);

$loadedSheetNames = $objPHPExcelReader->getSheetNames();

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcelReader, 'CSV');

foreach($loadedSheetNames as $sheetIndex => $loadedSheetName) {
    $objWriter->setSheetIndex($sheetIndex);
    $objWriter->save($loadedSheetName.'.csv');
}

Link to the library

Xenofexs
  • 511
  • 4
  • 14

0 Answers0