New plugin: xlsreader

Discuss questions about plugin development with the Hollywood SDK here
BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

New plugin: xlsreader

Post 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

User avatar
airsoftsoftwair
Posts: 4787
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: New plugin: xlsreader

Post by airsoftsoftwair »

Very nice! Can you do Amiga builds as well?

BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

Re: New plugin: xlsreader

Post 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.

User avatar
airsoftsoftwair
Posts: 4787
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: New plugin: xlsreader

Post 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.

BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

Re: New plugin: xlsreader

Post by BeChris »

Just added macos and macos64 versions in the github repository.

BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

Re: New plugin: xlsreader

Post 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 😉.

BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

Re: New plugin: xlsreader

Post 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 ?

SamuraiCrow
Posts: 424
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: New plugin: xlsreader

Post by SamuraiCrow »

Would the ComposeChar command work from Unicode.library?
I'm on registered MorphOS using FlowStudio.

BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

Re: New plugin: xlsreader

Post by BeChris »

Thanks for the tip.
I will try that.

BeChris
Posts: 23
Joined: Wed Apr 17, 2019 6:39 pm

Re: New plugin: xlsreader

Post 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.

Post Reply