Page 1 of 3

New plugin: xlsreader

Posted: Thu Mar 26, 2020 10:40 pm
by BeChris
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

Re: New plugin: xlsreader

Posted: Sat Mar 28, 2020 12:32 pm
by airsoftsoftwair
Very nice! Can you do Amiga builds as well?

Re: New plugin: xlsreader

Posted: Sun Mar 29, 2020 6:06 pm
by BeChris
Hello, I only own a PC computer under Manajro Linux 64 bits.
Therefore I managed to compile a version for Linux64 and Windows32 (using msvc under Wine).
But unfortunately I don't own any Amiga for more than 20 years.
I someone give me pointers to URLs that explain how to put in place an Amiga dev environment under UAE I'll give it a try.

Re: New plugin: xlsreader

Posted: Mon Mar 30, 2020 12:09 am
by airsoftsoftwair
Hmm, without any experience for the past 20 years it might be a little tricky because on AmigaOS things are a bit more complicated than on the mainstream OSs. This is covered in the AmigaOS peculiarities section of the Hollywood SDK.

As a C compiler for Hollywood plugins I recommend vbcc because it's really lightweight and easy to set up.

Re: New plugin: xlsreader

Posted: Tue Mar 31, 2020 10:48 pm
by BeChris
Just added macos and macos64 versions in the github repository.

Re: New plugin: xlsreader

Posted: Wed Apr 01, 2020 7:01 pm
by BeChris
I'm working on Amiga OS 3.x version using a cross toolchain installés on m'y Linux box.
Stat tunes for further news 😉.

Re: New plugin: xlsreader

Posted: Thu Apr 02, 2020 10:20 pm
by BeChris
I made an attemp in TEST_AMIGAOS3 branch but could not handle what I believe to be conversion from unicode to UTF-8.
On Linux it is done with libiconv but on Amiga ?

Someone interrested in helping on this plugin ?

Re: New plugin: xlsreader

Posted: Thu Apr 02, 2020 11:47 pm
by SamuraiCrow
Would the ComposeChar command work from Unicode.library?

Re: New plugin: xlsreader

Posted: Fri Apr 03, 2020 7:06 pm
by BeChris
Thanks for the tip.
I will try that.

Re: New plugin: xlsreader

Posted: Tue Apr 07, 2020 11:47 pm
by BeChris
I just modified conversion from unicode to UTF-8 function so that it now uses Unicode functions from Hollywood >= 7
I also added xlsreader.hwp compiled for os3, os3fpu and mos (MorphOS).

Could someone take a look at what I did in TEST_AMIGAOS3 branch ?

It would be a pity if this plugin is available only for Windows, MacOS and Linux !

Many thanks in advance.