Reading from xls or xlsx - with style

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
I'm aware that there are a couple of libraries floating around for reading
Excel documents - do any of them allow the formatting of runs of text within
cells to be read? I want to import some data where some of the text in a cell
may contain some parts which are in italics or bold. Are there existing
libraries that support this use?

Many thanks,

Ben

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
Ben,

i am uising Spreadlib and Excel Libary. Both do not take care for text format.
At least i am not aware of it.

Regards,
Matthias



Matthias Rebbe
Tel +49 5741 310000
https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌

> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>
> Many thanks,
>
> Ben
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
the style of the whole cell or range. We have no function to read the
style of each char, at this moment.
However, both VBA and AppleScript are offering this possibility, so
this is a function we can add. A possible solution would consist to
explore the style of each chars in a cell, then return the result in
html to have it directly usable in LiveCode. I'm not sure of the
performances of this approach, though. It will depend on how many
cells the sheet have and how many text each cells are containing.

On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
<[hidden email]> wrote:

> Ben,
>
> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
> At least i am not aware of it.
>
> Regards,
> Matthias
>
>
>
> Matthias Rebbe
> Tel +49 5741 310000
> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌
>
>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]>>:
>>
>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>
>> Many thanks,
>>
>> Ben
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email] <mailto:[hidden email]>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



--
Zryip TheSlug
http://www.aslugontheroad.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
It is amazing how many online xls to html converters are available . . .
if only one could get at their code . . .

This loooks a bit "dicky" as it is either to a barebones html file and a
load of connected files or to
something called an .mht or .mhtml file.

Here's something else:
http://www.softinterface.com/Convert-XLS/Features/Convert-XLS-To-HTML-XML.htm

Thinking . . .

Richmond.

On 16/1/2018 10:32 pm, zryip theSlug via use-livecode wrote:

> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
> the style of the whole cell or range. We have no function to read the
> style of each char, at this moment.
> However, both VBA and AppleScript are offering this possibility, so
> this is a function we can add. A possible solution would consist to
> explore the style of each chars in a cell, then return the result in
> html to have it directly usable in LiveCode. I'm not sure of the
> performances of this approach, though. It will depend on how many
> cells the sheet have and how many text each cells are containing.
>
> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
> <[hidden email]> wrote:
>> Ben,
>>
>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>> At least i am not aware of it.
>>
>> Regards,
>> Matthias
>>
>>
>>
>> Matthias Rebbe
>> Tel +49 5741 310000
>> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌
>>
>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]>>:
>>>
>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>
>>> Many thanks,
>>>
>>> Ben
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
As i wrote “ at least i am not aware of it” ;)

good to know. That this is possible.

Btw.: Do you know if it is also possible to read/get the tooltip of a cell of better said of a range of cells?

Regards
Matthias


Matthias Rebbe
Tel +49 5741 310000
https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌

> Am 16.01.2018 um 21:32 schrieb zryip theSlug via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
> the style of the whole cell or range. We have no function to read the
> style of each char, at this moment.
> However, both VBA and AppleScript are offering this possibility, so
> this is a function we can add. A possible solution would consist to
> explore the style of each chars in a cell, then return the result in
> html to have it directly usable in LiveCode. I'm not sure of the
> performances of this approach, though. It will depend on how many
> cells the sheet have and how many text each cells are containing.
>
> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
> <[hidden email] <mailto:[hidden email]>> wrote:
>> Ben,
>>
>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>> At least i am not aware of it.
>>
>> Regards,
>> Matthias
>>
>>
>>
>> Matthias Rebbe
>> Tel +49 5741 310000
>> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/> <https://matthiasrebbe.eu/ <https://matthiasrebbe.eu/>>‌
>>
>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>>:
>>>
>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>
>>> Many thanks,
>>>
>>> Ben
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email] <mailto:[hidden email]>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>
>
>
> --
> Zryip TheSlug
> http://www.aslugontheroad.com <http://www.aslugontheroad.com/>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
Open Office can read Excel files and successfully export them to .html
preserving ALL formatting!

As Open Office is open source code . . . .

https://www.openoffice.org/

I have just imported a styled .html file exported from an Open Office
Spreadsheet into a textField in LiveCode 7.1.4

Richmond.

On 16/1/2018 10:32 pm, zryip theSlug via use-livecode wrote:

> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
> the style of the whole cell or range. We have no function to read the
> style of each char, at this moment.
> However, both VBA and AppleScript are offering this possibility, so
> this is a function we can add. A possible solution would consist to
> explore the style of each chars in a cell, then return the result in
> html to have it directly usable in LiveCode. I'm not sure of the
> performances of this approach, though. It will depend on how many
> cells the sheet have and how many text each cells are containing.
>
> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
> <[hidden email]> wrote:
>> Ben,
>>
>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>> At least i am not aware of it.
>>
>> Regards,
>> Matthias
>>
>>
>>
>> Matthias Rebbe
>> Tel +49 5741 310000
>> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌
>>
>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]>>:
>>>
>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>
>>> Many thanks,
>>>
>>> Ben
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
If you could find a way to export a tab-delimited RTF file from your
spreadsheet program
you might be laughing.

Richmond.

On 16/1/2018 10:54 pm, Richmond Mathewson wrote:

> Open Office can read Excel files and successfully export them to .html
> preserving ALL formatting!
>
> As Open Office is open source code . . . .
>
> https://www.openoffice.org/
>
> I have just imported a styled .html file exported from an Open Office
> Spreadsheet into a textField in LiveCode 7.1.4
>
> Richmond.
>
> On 16/1/2018 10:32 pm, zryip theSlug via use-livecode wrote:
>> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
>> the style of the whole cell or range. We have no function to read the
>> style of each char, at this moment.
>> However, both VBA and AppleScript are offering this possibility, so
>> this is a function we can add. A possible solution would consist to
>> explore the style of each chars in a cell, then return the result in
>> html to have it directly usable in LiveCode. I'm not sure of the
>> performances of this approach, though. It will depend on how many
>> cells the sheet have and how many text each cells are containing.
>>
>> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
>> <[hidden email]>  wrote:
>>> Ben,
>>>
>>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>>> At least i am not aware of it.
>>>
>>> Regards,
>>> Matthias
>>>
>>>
>>>
>>> Matthias Rebbe
>>> Tel +49 5741 310000
>>> ‌https://matthiasrebbe.eu  <https://matthiasrebbe.eu/>‌
>>>
>>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email]  <mailto:[hidden email]>>:
>>>>
>>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>>
>>>> Many thanks,
>>>>
>>>> Ben
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]  <mailto:[hidden email]>
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
If you export html from Open Office Calc / Excel, then import it into a
textfield, and then
move it into a Basic Table Field like this:

set the columnDelimiter to TAB
set the htmlText of fld "fSPREAD" to the text of fld "fTEXT"

where field "fSPREAD" is a table field

all the styling from your original spreadsheet file [ .ods / .xls ] will
be preserved.

The ONLY problem is that the data is spreas apart over many "cells", but
that should be capable
of being cleared up comparatively simply.

Richmond.


On 16/1/2018 11:32 pm, Richmond Mathewson wrote:

> If you could find a way to export a tab-delimited RTF file from your
> spreadsheet program
> you might be laughing.
>
> Richmond.
>
> On 16/1/2018 10:54 pm, Richmond Mathewson wrote:
>> Open Office can read Excel files and successfully export them to
>> .html preserving ALL formatting!
>>
>> As Open Office is open source code . . . .
>>
>> https://www.openoffice.org/
>>
>> I have just imported a styled .html file exported from an Open Office
>> Spreadsheet into a textField in LiveCode 7.1.4
>>
>> Richmond.
>>
>> On 16/1/2018 10:32 pm, zryip theSlug via use-livecode wrote:
>>> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
>>> the style of the whole cell or range. We have no function to read the
>>> style of each char, at this moment.
>>> However, both VBA and AppleScript are offering this possibility, so
>>> this is a function we can add. A possible solution would consist to
>>> explore the style of each chars in a cell, then return the result in
>>> html to have it directly usable in LiveCode. I'm not sure of the
>>> performances of this approach, though. It will depend on how many
>>> cells the sheet have and how many text each cells are containing.
>>>
>>> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
>>> <[hidden email]>  wrote:
>>>> Ben,
>>>>
>>>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>>>> At least i am not aware of it.
>>>>
>>>> Regards,
>>>> Matthias
>>>>
>>>>
>>>>
>>>> Matthias Rebbe
>>>> Tel +49 5741 310000
>>>> ‌https://matthiasrebbe.eu  <https://matthiasrebbe.eu/>‌
>>>>
>>>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email]  <mailto:[hidden email]>>:
>>>>>
>>>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Ben
>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> [hidden email]  <mailto:[hidden email]>
>>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
Matthias, if by tooltip, you meant the comment associated to a cell,
yes this is something potentially possible, too.


On Tue, Jan 16, 2018 at 9:52 PM, Matthias Rebbe via use-livecode
<[hidden email]> wrote:

> As i wrote “ at least i am not aware of it” ;)
>
> good to know. That this is possible.
>
> Btw.: Do you know if it is also possible to read/get the tooltip of a cell of better said of a range of cells?
>
> Regards
> Matthias
>
>
> Matthias Rebbe
> Tel +49 5741 310000
> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌
>
>> Am 16.01.2018 um 21:32 schrieb zryip theSlug via use-livecode <[hidden email] <mailto:[hidden email]>>:
>>
>> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
>> the style of the whole cell or range. We have no function to read the
>> style of each char, at this moment.
>> However, both VBA and AppleScript are offering this possibility, so
>> this is a function we can add. A possible solution would consist to
>> explore the style of each chars in a cell, then return the result in
>> html to have it directly usable in LiveCode. I'm not sure of the
>> performances of this approach, though. It will depend on how many
>> cells the sheet have and how many text each cells are containing.
>>
>> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>> Ben,
>>>
>>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>>> At least i am not aware of it.
>>>
>>> Regards,
>>> Matthias
>>>
>>>
>>>
>>> Matthias Rebbe
>>> Tel +49 5741 310000
>>> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/> <https://matthiasrebbe.eu/ <https://matthiasrebbe.eu/>>‌
>>>
>>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>>:
>>>>
>>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>>
>>>> Many thanks,
>>>>
>>>> Ben
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>>
>>
>>
>> --
>> Zryip TheSlug
>> http://www.aslugontheroad.com <http://www.aslugontheroad.com/>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email] <mailto:[hidden email]>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



--
Zryip TheSlug
http://www.aslugontheroad.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode

Ben wrote:

 > I want to import some data where some of the text in a
 > cell may contain some parts which are in italics or bold.

SpreadLib doesn't have styles for IMPORT yet, but SpreadOut already has
them for EXPORT. Text size, bold/italic/etc, pics. At least my dev
version does! I need to wrap up this version for public release - I'll
try to speed that up and get it posted soon.

(Depending on how close they are to completion, FieldTrip may be first
in line for update, because I had several requests for it and haven't
forgotten.)

SpreadOut was lucky and got the style features and pics implemented
first, and it's pretty cool to save stylin' spreadsheets from Livecode.
I'll have to add those features to the import code in another version.
Perhaps italic and bold can come sooner than the rest, we'll see.

There's so much that Excel and other spreadsheets can do, really amazing
and handy. Using the genuine and original SpreadLib library, it's easy
to import to a LiveCode field or array and use the data to empower all
sorts of projects.

Best wishes,

Curry Kenworthy

WordLib: Take charge of MS Word and OpenOffice documents
SpreadLib: "Excel-lent" spreadsheet import/export for LC
http://livecodeaddons.com/


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Reading from xls or xlsx - with style

Matthias Rebbe via use-livecode
In reply to this post by Matthias Rebbe via use-livecode
Thanks all for the suggestions.

In fact I found that although the docs for xlsx (aka OpenXML aka ECMA-376 aka
ISO/IEC 29500) are a dense nightmare*, simply taking a close look at the
format shows it's pretty simple to parse by reading the files directly, at
least for my needs (just text and other literal values, in some cases with
style, not caring about formulas, charts etc).

(If I wanted a more straightforward life, and was prepared to do some manual
work on each file before processing it, and I/my client didn't have concerns
about sharing internal data with Google, I did before getting this far
establish that the easiest solution would be to import the spreadsheet into
Google Sheets, which has a nice straightforward API for getting the data.)

So, thanks all - and if a visitor from the future is reading this thread
because they have a similar requirement, my suggestion is to either run it
through Google Sheets, or hack the xslx directly.

Ben

*Part 1 of the reference is a 5,036 page document. I didn't bother downloading
the following parts...

On 16/01/2018 21:55, zryip theSlug via use-livecode wrote:

> Matthias, if by tooltip, you meant the comment associated to a cell,
> yes this is something potentially possible, too.
>
>
> On Tue, Jan 16, 2018 at 9:52 PM, Matthias Rebbe via use-livecode
> <[hidden email]> wrote:
>> As i wrote “ at least i am not aware of it” ;)
>>
>> good to know. That this is possible.
>>
>> Btw.: Do you know if it is also possible to read/get the tooltip of a cell of better said of a range of cells?
>>
>> Regards
>> Matthias
>>
>>
>> Matthias Rebbe
>> Tel +49 5741 310000
>> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/>‌
>>
>>> Am 16.01.2018 um 21:32 schrieb zryip theSlug via use-livecode <[hidden email] <mailto:[hidden email]>>:
>>>
>>> In the Excel Lib, the command XCEL_Range_FontStyle_Get is returning
>>> the style of the whole cell or range. We have no function to read the
>>> style of each char, at this moment.
>>> However, both VBA and AppleScript are offering this possibility, so
>>> this is a function we can add. A possible solution would consist to
>>> explore the style of each chars in a cell, then return the result in
>>> html to have it directly usable in LiveCode. I'm not sure of the
>>> performances of this approach, though. It will depend on how many
>>> cells the sheet have and how many text each cells are containing.
>>>
>>> On Tue, Jan 16, 2018 at 8:23 PM, Matthias Rebbe via use-livecode
>>> <[hidden email] <mailto:[hidden email]>> wrote:
>>>> Ben,
>>>>
>>>> i am uising Spreadlib and Excel Libary. Both do not take care for text format.
>>>> At least i am not aware of it.
>>>>
>>>> Regards,
>>>> Matthias
>>>>
>>>>
>>>>
>>>> Matthias Rebbe
>>>> Tel +49 5741 310000
>>>> ‌https://matthiasrebbe.eu <https://matthiasrebbe.eu/> <https://matthiasrebbe.eu/ <https://matthiasrebbe.eu/>>‌
>>>>
>>>>> Am 16.01.2018 um 19:10 schrieb Ben Rubinstein via use-livecode <[hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>>:
>>>>>
>>>>> I'm aware that there are a couple of libraries floating around for reading Excel documents - do any of them allow the formatting of runs of text within cells to be read? I want to import some data where some of the text in a cell may contain some parts which are in italics or bold. Are there existing libraries that support this use?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Ben
>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email] <mailto:[hidden email]>>
>>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>
>>>
>>>
>>> --
>>> Zryip TheSlug
>>> http://www.aslugontheroad.com <http://www.aslugontheroad.com/>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode