views:

249

answers:

4

I'm trying to read a 17MB excel file (2003) with PHPExcel1.7.3c, but it crushes already while loading the file, after exceeding the 120 seconds limit I have. Is there another library that can do it more efficiently? I have no need in styling, I only need it to support UTF8. Thanks for your help

+1  A: 

17MB is a hefty file.

Time how long a 1MB file takes to parse so you can work out how long a 17MB file would take. Then one option might be just to increase your 120 second limit.

Alternatively, you could export to CSV, which will be way more efficient, and import via PHP's fgetcsv.

Snow Crash
+3  A: 

Filesize isn't a good measure when using PHPExcel, it's more important to get some idea of the number of cells (rowsxcolumns) in each worksheet.

If you have no need for styling, are you calling:

$objReader->setReadDataOnly(true);

before loading the file?

If you don't need to access all worksheets, or only certain cells within a worksheet, look at using

$objReader->setLoadSheetsOnly(array(1,2))

or

$objReader->setLoadSheetsOnly(1)

or defining a readFilter

Are you using cell caching? If so, what method? That slows down the load time.

Mark Baker
+1  A: 

I've heard that Excel Explorer is better in reading large files.

Sjoerd
At $500 for commercial use, I'd hope it would be better
Mark Baker
Price and quality have no correlation. You only need a $99 personal license if you want to use it for your own web application.
Sjoerd
A: 

Maybe you could convert/export into csv, and use built-in fgetcsv(). Depends on what kind of functionality you need.

galambalazs