Page 2 of 3

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Thu Sep 26, 2019 9:53 am
by kaveh1000
Hi Richmond

First of all, you have solved my problem, with

Code: Select all

textdecode(...)
Thanks a million!

I am not using CSV because of the anomalies that you have come up with. I believe CSV is a terrible format, using a commonly used character (comma) to separate cells. For this it has to automatically put in quotation marks (but not always!) Then you get the problem of quotations that might occur inside cells. Then they have to be escaped!! Somehow I got JSON output to work and it does not have these problems.

Thanks again and I am watching this thread still. :-)

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Thu Sep 26, 2019 11:59 am
by richmond62
On my way home for lunch I bumped into a professional programmer (the type who earns $20,000 a month)
and decided to be a pain-in-the-bum (surely not, Richmond?): he told me the reason I was probably having
difficulties with returns in dealing with .csv files was because I was importing
them as text files rather than binary files . . .

. . . unfortunately the fact that my wife is going to arrive any minute now exhausted from an early start and ravenously hungry
meant that I cooked her some lunch rather than experimenting with a binfile method.

So; this evening . . . 8)

Unfortunately kaveh1000 my brain has taken over (spent the night hallucinating about spreadsheets), so, while
the fact that you have solved your problem via JSON, I am still going to give .csv my best shot.
-
Screenshot 2019-09-26 at 14.01.48.png
Screenshot 2019-09-26 at 14.01.48.png (11.01 KiB) Viewed 9332 times

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Thu Sep 26, 2019 12:06 pm
by richmond62
I would, however, be extremely grateful if you could tell me (as well as sharing it
with all these folk who are watching my lunacy) how you got hold of a JSON
document from Google Sheets.

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Thu Sep 26, 2019 12:11 pm
by kaveh1000
I had some great offline help from Thierry (author of sunnYrex), and somehow I managed to grab the JSON. Please see stack in this post:

https://forums.livecode.com/viewtopic.p ... on#p182782

I had to do some more massaging after that.

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Thu Sep 26, 2019 12:12 pm
by richmond62
more massaging
Well; just so far as it only involves only massaging: I draw a line at whips and chains. :)

This looks "kinky", but may only work with MSOffice on Windows:

https://superuser.com/questions/1249898 ... -json-file

This seems more universal:

https://www.youtube.com/embed/HnFwl-8aT ... autoplay=1

mind you, it would involve the LiveCode stack sending some Javascript to the Google sheet . .

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Thu Sep 26, 2019 12:14 pm
by kaveh1000
:-) missing all the fun sire!

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Fri Sep 27, 2019 9:45 am
by richmond62
What a b*mmer, my routine to strip cr chars from the data removes both the in-cell cr codes AND the ones that tells us to
move down a line in our spreadsheet.
-
Screenshot_20190927_114937.png

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Fri Sep 27, 2019 9:58 am
by kaveh1000
sorry! But CSV is a horrible format and there is always a surprise lurking!

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Fri Sep 27, 2019 10:30 am
by richmond62
CSV is a horrible format
So it seems.

However, you don't need to apologise as I do not hold you personally responsible for the CSV format. :D

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Fri Sep 27, 2019 11:01 am
by richmond62
Screenshot_20190927_130033.png
Screenshot_20190927_130033.png (5.91 KiB) Viewed 9209 times
-
Hey-Ho: htmlText provides its own kind of fun.

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Fri Sep 27, 2019 10:57 pm
by kaveh1000
Now you're really asking for trouble. ;-)

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Sat Sep 28, 2019 6:22 am
by richmond62
asking for trouble
I dunno: I seem to have spent most of my life either getting into trouble
or causing other people trouble: so messing around with stuff coming out
of spreadsheets just feels like business as usual. 8)

"Nothing ventured, nothing gained."

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Sun Sep 29, 2019 4:24 pm
by AndyP
What about using a service like this?

https://sheetapi.co/

Turn Google Sheet into RESTful API's

They have a free option..

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Sun Sep 29, 2019 4:33 pm
by richmond62
That's kinda groovy: but the original OP was asking about "sucking" something
directly from an open Google sheet into something in Livecode without any intermediate steps.

Also: that lot will start grabbing your moolah before you are halfway done.
-
2bucks.jpg
2bucks.jpg (14.12 KiB) Viewed 9083 times
-
Note my name is "right there." 8)
-
Far, far better to find a way without any intermediate steps, whether 'pay' or otherwise.

Re: Accessing Google Sheets in Standalone – Inclusions needed?

Posted: Sun Sep 29, 2019 4:44 pm
by kaveh1000
I agree with you Richmond. I am almost there with a solution. I am sorry this has split across two threads now, probably because I referred to the other one from here. See Bernd's response here:

https://forums.livecode.com/viewtopic.p ... on#p182782

textdecode worked for me as as Bernd said not all unicode chars are translated correctly. I have tried his method for converting \u2022 etc and almost all chars work.

If you have any comments on that I suggest you post in that thread.

Thanks to all for suggestions.

Kaveh