![]() |
php excel reader - problem reading multiple files at once - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: php excel reader - problem reading multiple files at once (/showthread.php?tid=35288) |
php excel reader - problem reading multiple files at once - El Forum - 10-25-2010 [eluser]Unknown[/eluser] Hi, i'm using Codeigniter 1.7.2 with the PHP Excel Reader found in the Codeigniter Wiki. The standard use is to provide the filename of the Excel like this: Code: $params = array(‘file’ => $pathToFile, ‘store_extended_info’ => true,‘outputEncoding’ => ‘’); I read the XLS files in a model, but due to that, that i have to read multiple files i cannot assign in the model constructor the filename to be read. I do it later in the specific functions. My constructor looks like this: Code: function Chartsofc() { I provide only store_extended_info false and standard encoding. Later on in the functions i call the ***read*** method of the php_excel_reader library like this: Code: function get_sheet_names($File) { I think the problem is that php-excel-reader opens the files but does not close them. There is no method to close them. Also i dont see that php-excel-reader is closing the files automatically. I got a function which first reads all excels and gets me the sheetnames, but the for reading i need to get the sheet index. i wrote a function for that and i works on lone files, but when i read here more and twice it produces wrong results This is because php-excel-reader's read function is called twice: in $this->get_sheet_names($files[$index]); and later in: $this->get_sheet_index_by_name("xls\\" . $fs_arr[$index2][0] , $fs_arr[$index2][1]); Code: function get_tags() { Then i got 4 XLS files and in produces a output of: Code: //name - index Instead of getting the right indexes of the sheets Code: //name - index Any ideas what to do? Is my seperated providing of the xls filename ok? |