返回匿名值的php电子表格excel阅读器
我正在使用php电子表格excel阅读器读取excel文件并进行一些操作。 它工作正常,对于整数列,它突然开始返回值'General'返回匿名值的php电子表格excel阅读器,php,excel,codeigniter,phpexcelreader,Php,Excel,Codeigniter,Phpexcelreader,我正在使用php电子表格excel阅读器读取excel文件并进行一些操作。 它工作正常,对于整数列,它突然开始返回值'General' Sample rows from excel: 代码: $dataFields = array("alias"=>"alias","store_quantity"=>"store_quantity","godown_quantity"=>"godown_quantity","name"=>"name"); $mandatoryFei
Sample rows from excel:
代码:
$dataFields = array("alias"=>"alias","store_quantity"=>"store_quantity","godown_quantity"=>"godown_quantity","name"=>"name");
$mandatoryFeilds = array("alias","store_quantity","godown_quantity","name");
$fieldsPos = array();
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('CP1251');
$data->read($_FILES['upload-file']['tmp_name']);
for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++)
{
if ( isset($data->sheets[0]['cells'][1][$j]) == true )
{
$fieldsPos[$data->sheets[0]['cells'][1][$j]] = $j;
if(array_search($data->sheets[0]['cells'][1][$j],$mandatoryFeilds)!==false)
{
unset($mandatoryFeilds[array_search($data->sheets[0]['cells'][1][$j],$mandatoryFeilds)]);
}
}
}
if(count($mandatoryFeilds)>0)
{
die('Some of the mandatory columns are missing in excel');
}
for ($i = 2; $i <= $data->sheets[0]['numRows']; $i++)
{
//printing the output here to check values received from excel which are some anonymous values getting returned
var_dump($data->sheets[0]['cells'][$i]);
}
array("alias"=>"General","name"=>"Item A","store_quantity"=>"General","godown_quantity"=>"General")
有人能帮我吗?任何帮助都将不胜感激问题的发生是因为我将我的操作系统从Ubuntu 14更新为Ubuntu 16,并将Libre Office版本从4.2更新为5
libre5中的excel文件正以上述方式读取。因此,这与Libre版本有关,而不是电子表格阅读器的任何内容。我也有同样的问题。结果那些细胞被阻断了。这就是电子表格阅读器无法正确阅读的原因。据我所查,问题出现在Libre Office 5上 编辑Excel工作表时未进入Windows 我通过读取整数情况下cellsinfo的原始字段来处理此问题:
$data = new JPhpExcelReader($filename);
$id = $data->sheets[0]['cellsInfo'][$i][1]['raw'];