Getting JSON from Google Sheets with unicode chars
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Getting JSON from Google Sheets with unicode chars
Thanks Kaveh,kaveh1000 wrote: ↑Mon Sep 30, 2019 9:01 pmLeast I can do for you Bernd!!
https://docs.google.com/spreadsheets/d/ ... sp=sharing
but this one also has only one column. Could you add a couple of columns?
Thanks
Bernd
Re: Getting JSON from Google Sheets with unicode chars
Hi Kaveh,
https://docs.google.com/spreadsheets/d/ ... sp=sharing
when I open the url in a browser I see 4 columns but only one is retrieved via your retrieval routine. And that one column is the same as before. Could you test this in your copy of "putJasonIntoTable.livecode"?
Column 2 and 4 have a lot of backslashes and curly brackets. Probably not the best test cases for Jason.
Kind regards
Bernd
https://docs.google.com/spreadsheets/d/ ... sp=sharing
when I open the url in a browser I see 4 columns but only one is retrieved via your retrieval routine. And that one column is the same as before. Could you test this in your copy of "putJasonIntoTable.livecode"?
Column 2 and 4 have a lot of backslashes and curly brackets. Probably not the best test cases for Jason.
Kind regards
Bernd
Re: Getting JSON from Google Sheets with unicode chars
did you put "four_rows" into the sheet name? I did and I think the columns are all coming in when I step through. However something seems to crash it out in the repeat look with numToCodepoint.
I bet it is one of the colons.
I have set up another sheet now, sheet4:
https://docs.google.com/spreadsheets/d/ ... 1713871980
you can edit this one, so do whatever...
I get repeating columns of numbers and then I think the fourth column..
I bet it is one of the colons.
I have set up another sheet now, sheet4:
https://docs.google.com/spreadsheets/d/ ... 1713871980
you can edit this one, so do whatever...
I get repeating columns of numbers and then I think the fourth column..
Kaveh
Re: Getting JSON from Google Sheets with unicode chars
Hi Kaveh,
I found the problem. The first one was a bug I did not catch with only one column. I overwrote rows with row numbers instead of only applying them to the first item only.
The second problem was in "four_rows" where you had a "\u" as a literal and it broke my assumption that "\u" is always the begin of a unicode hex.
Solution: I replaced "\\u" with "backslashU" in tData and restore after resolving unicode hex stuff.
I added an option menu where you can choose the four sheets I see easily and they all work now. It is good that you put up the torture tests and I am glad that they work now.
Kind regards
Bernd
I found the problem. The first one was a bug I did not catch with only one column. I overwrote rows with row numbers instead of only applying them to the first item only.
The second problem was in "four_rows" where you had a "\u" as a literal and it broke my assumption that "\u" is always the begin of a unicode hex.
Solution: I replaced "\\u" with "backslashU" in tData and restore after resolving unicode hex stuff.
I added an option menu where you can choose the four sheets I see easily and they all work now. It is good that you put up the torture tests and I am glad that they work now.
Kind regards
Bernd
- Attachments
-
- putJasonIntoTable_2.livecode.zip
- now with even less errors
- (2.46 KiB) Downloaded 249 times
Re: Getting JSON from Google Sheets with unicode chars
Kaveh,
glad it helps. Is this helpful for your project?
This does not solve the problem of a cell containg more than one line. But I don't know of a way in livecode to put multiple lines into one cell of a table.
I had a look at the code again and there is one remnant line of an earlier attempt in handler "resolveArrayIntoTable"
KInd regards
Bernd
glad it helps. Is this helpful for your project?
This does not solve the problem of a cell containg more than one line. But I don't know of a way in livecode to put multiple lines into one cell of a table.
I had a look at the code again and there is one remnant line of an earlier attempt in handler "resolveArrayIntoTable"
which has no function in the current version. You could delete that line.put pDataArray["table"]["rows"][aRow]["c"] into tColumnNumber
KInd regards
Bernd
Re: Getting JSON from Google Sheets with unicode chars
Hi Bernd
Yes, this is very helpful, as I have so many strange characters. So glad I had the "\u" in the set and so glad you spent time solving it!! I still have not had time to go thro in detail but it will be very useful for me to do that.
I don't actually need the data in a table in LiveCode. I think I can work out a way of dealing with returns in a cell.
thanks again.
Yes, this is very helpful, as I have so many strange characters. So glad I had the "\u" in the set and so glad you spent time solving it!! I still have not had time to go thro in detail but it will be very useful for me to do that.
I don't actually need the data in a table in LiveCode. I think I can work out a way of dealing with returns in a cell.
thanks again.
Kaveh