Extra spaces in .XLS files

Roger Eller roger.e.eller at sealedair.com
Wed Sep 21 13:05:39 EDT 2016


On Wed, Sep 21, 2016 at 9:51 AM, Peter TB Brett <peter.brett at livecode.com>
wrote:

> On 21/09/2016 13:25, Roger Eller wrote:
>
>> Has anyone here ever ran into this?  When I put URL
>> ("file:/path/to/file.xls") into field "imported text", EVERY character has
>> an extra space following it.
>>
>> Example:  c e l l 1 TAB c e l l 2 TAB h e l l o  w o r l d
>>
>> I can script them away to normalize the text, but I find it to be strange.
>>
>
> Hi Roger,
>
> You didn't tell LiveCode how to decode the file, so it's using it's naive
> default decoding strategy (1 byte per character, native encoding) which is
> almost certainly not what you want.
>
> Try something like:
>
>     textDecode(url "binfile://path/to/file.xls", "utf-16")
>
> This is also wrong (.xls files are big balls of complicated binary data,
> not text) but it might get you marginally closer.
>
>                                   Peter
>
> --
> Dr Peter Brett <peter.brett at livecode.com>
> LiveCode Technical Project Manager
>

Thanks Peter!  Had I been working in 8.x that would have done the trick.
You pointed me in the right direction though.

My legacy stack is in 6.x so I had to:

get uniDecode(url ("binfile://path/to/file.xls"))

~Roger



More information about the use-livecode mailing list