Reading from xls or xlsx - with style

Ben Rubinstein benr_mc at cogapp.com
Thu Jan 18 12:26:25 EST 2018


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
> <use-livecode at lists.runrev.com> 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 <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>:
>>>
>>> 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
>>> <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> 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 <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>:
>>>>>
>>>>> 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
>>>>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>
>>>>> 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
>>>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
>>>> 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
>>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
>>> 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
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> 




More information about the use-livecode mailing list