New plugin: xlsreader
Posted: Thu Mar 26, 2020 10:40 pm
Hello,
For my own needs I developped a plugin which is able to parse an .xls file and return the content of this file as a table (only cells texts are extracted, not format).
It is based on libxls C library available here : https://github.com/libxls/libxls
Do what you want with it.
Available here : https://github.com/BeChris/Hollywood-xlsreader
(in build directory there are xlsreader.hwp already compiled for linux64 and win32 platforms)
Short README:
/* Open an .xls file and:
** 1)If everything went well return its content as a table as described below:
** {
** ["first tab"] = {
** (note:first row) {"First column value", "Second column value", "Third column value", ...},
** (note:second row) {"First column value", "Second column value", "Third column value", ...},
** (note:third row) {"First column value", "Second column value", "Third column value", ...},
** ...
** },
** ["second tab"] = {
** (note:first row) {"First column value", "Second column value", "Third column value", ...},
** (note:second row) {"First column value", "Second column value", "Third column value", ...},
** (note:third row) {"First column value", "Second column value", "Third column value", ...},
** ...
** },
** ...
** }
**
** 2)If something went wrong raise an error containing message
*/
To use it:
@REQUIRE "xlsreader"
ExitOnError(False)
content = xlsreader.OpenXls(<path_to_an_xls_file>)
error = GetLastError()
ExitOnError(True)
; Now do what you want with content which is a table
For my own needs I developped a plugin which is able to parse an .xls file and return the content of this file as a table (only cells texts are extracted, not format).
It is based on libxls C library available here : https://github.com/libxls/libxls
Do what you want with it.
Available here : https://github.com/BeChris/Hollywood-xlsreader
(in build directory there are xlsreader.hwp already compiled for linux64 and win32 platforms)
Short README:
/* Open an .xls file and:
** 1)If everything went well return its content as a table as described below:
** {
** ["first tab"] = {
** (note:first row) {"First column value", "Second column value", "Third column value", ...},
** (note:second row) {"First column value", "Second column value", "Third column value", ...},
** (note:third row) {"First column value", "Second column value", "Third column value", ...},
** ...
** },
** ["second tab"] = {
** (note:first row) {"First column value", "Second column value", "Third column value", ...},
** (note:second row) {"First column value", "Second column value", "Third column value", ...},
** (note:third row) {"First column value", "Second column value", "Third column value", ...},
** ...
** },
** ...
** }
**
** 2)If something went wrong raise an error containing message
*/
To use it:
@REQUIRE "xlsreader"
ExitOnError(False)
content = xlsreader.OpenXls(<path_to_an_xls_file>)
error = GetLastError()
ExitOnError(True)
; Now do what you want with content which is a table