Getting data out of Excel

dunbarx at aol.com dunbarx at aol.com
Wed Jul 24 03:13:42 EDT 2013


Kay.


I think Michael mentioned that he could do the housekeeping. He was wondering why excel padded the data so oddly, So do I. I have seen excel do odd things now and then.


But Michael, if you take an excel spreadsheet and copy a few lines of data that each have a few columns, and, say, in a brand new dataGrid set the dgText to the clipboardData, does the info load correctly, with the columns set and all?


And if you get the length of the clipBoardData, knowing that each tab and all returns but the last one count as a char, does the value seem right?


Craig Newman



-----Original Message-----
From: Kay C Lan <lan.kc.macmail at gmail.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Wed, Jul 24, 2013 2:42 am
Subject: Re: Getting data out of Excel


If you are absolutely sure that the clipboardData["text"] has return
represented by six spaces, and tabs by 3 spaces, then:
put clipboardData["text"] into tData
replace "      " with return in tData
repace "   " with tab in tData

Will only take milliseconds to do what you need! How much quicker do you
want?

On Wed, Jul 24, 2013 at 11:09 AM, Michael Julian Lew <
michaell at unimelb.edu.au> wrote:

> I'm trying to paste data from MS Excel into a table in my Livecode stack
> without success. I suspect that either OSX or Excel have added unwelcome
> complications.
>
> I used to be able to just paste, but nowadays (Excel 2011 Mac OSX 10.7.4)
> the data come in as a long string, with six spaces where a return should be
> and three where a tab should be. Putting the clipboardData["text"] makes no
> difference, and the clipboardData["RTF"] is not what I want.
>
> I can make it work by copying cells in Excel, then Paste Text Only in
> Nisus Writer Pro, then copying and pasting the text from there.
>
> I can write a function to clean up the clipboardData, but it seems silly
> to need to do so. Does anyone have a quick solution?
>
> Regards,
> Michael Lew
>
> _______________________________________________
> 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
>
_______________________________________________
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