A
A
Alexander2014-09-17 21:35:35
PHP
Alexander, 2014-09-17 21:35:35

What is the best way to import from XLS to PHP?

There was a similar topic: Parsing XLS using PHP, but I did not see the optimal solution in it.
Actually, the question is how to parse an old Excel file on a server (Debian) with minimal load?
At the output, you just need an array of data (do not care about formatting and pictures).
It should be noted that the files can be quite large (about 20 thousand lines).
What I tried:
PHPExcel - imports, but eats a lot of memory. The developers, in my opinion, are too confused with formatting support.
ABC Excel Parser Pro (at least that's what it says in the class header, it's lying around on the net under different names) is a better option, but it's still slow.
Read more about the extensionphp_excel + LibXL , but it costs $200 and my toad minds a little.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
evnuh, 2014-09-17
@aspetek

> apt-get install catdoc # в пакете catdoc есть утилита xls2csv
> xls2csv file.xls > file.csv

Further, in PHP we already read this csv-shku line by line with the fgetcsv function.

S
Sergey, 2014-09-17
Protko @Fesor

The developers, in my opinion, are too confused with formatting support.

and what's the point then in the library if it will not be able to basic?
You can convert the file to xlsx and then work with faster libraries or directly parse xml from xpath.
If you only need to pull out the data, you can generally dump it into CVS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question