TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: snownut2 on March 13, 2019, 04:56:07 PM

Title: Google Sheet file access
Post by: snownut2 on March 13, 2019, 04:56:07 PM
Anyone been successful in reading a Google sheet file, and using the data via LISP.  No need to write just read.
Title: Re: Google Sheet file access
Post by: ChrisCarlson on March 13, 2019, 05:20:04 PM
Have an example file? I would envision that a Google sheet file might only reference the web location for the file.
Title: Re: Google Sheet file access
Post by: dubb on March 13, 2019, 05:29:27 PM
I'm interested as well.
Theortically,  the only work around I can think of would be to link google sheet to an excel sheet and use datalink in autocad to bring in the data.
Title: Re: Google Sheet file access
Post by: snownut2 on March 13, 2019, 06:22:00 PM
Well I've just made it a bit easier (I think), I've sync'd the file with a Dropbox file, I believe that may make access a bit easier.  Attached is the file with just the headers.  All data will be populated with a form run from a tablet of phone, then appended to the file (that part is all done).  I now need to be able to read the file to import the data to CAD (in my case BricsCad)

Heres the link to the Dropbox file  https://www.dropbox.com/preview/Zoho/SA_Test-Pit_Log.xlsx?role=personal
Title: Re: Google Sheet file access
Post by: VovKa on March 13, 2019, 06:29:49 PM
give us the direct link to a shared Sheet -> https://docs.google.com/spreadsheets...bla bla bla
Title: Re: Google Sheet file access
Post by: VovKa on March 13, 2019, 07:31:27 PM
no need to mess with DropBox
Code: [Select]
(setq Table (vk_DownloadFile (strcat GoogleSheetURL "/export?format=tsv&") nil))
then split Table with "\r\n" then split every row with "\t"
Title: Re: Google Sheet file access
Post by: dubb on March 13, 2019, 07:52:05 PM
Nice implementation.

Where is this function
Quote
vk_DownloadFile


no need to mess with DropBox
Code: [Select]
(setq Table (vk_DownloadFile (strcat GoogleSheetURL "/export?format=tsv&") nil))
then split Table with "\r\n" then split every row with "\t"
Title: Re: Google Sheet file access
Post by: VovKa on March 13, 2019, 08:13:31 PM
Where is this function
Quote
vk_DownloadFile
https://www.theswamp.org/index.php?topic=33750.msg391249#msg391249
Title: Re: Google Sheet file access
Post by: snownut2 on March 14, 2019, 07:20:33 AM
VoVka
That worked perfectly (as usual) thanks.
Title: Re: Google Sheet file access
Post by: dubb on March 27, 2019, 02:19:31 PM
Reading sheets is working great. I was also able to add an sql query into the string.

How do we vk_download google sheets on file that are not publicly shared?
Title: Re: Google Sheet file access
Post by: VovKa on March 27, 2019, 03:15:15 PM
How do we vk_download google sheets on file that are not publicly shared?
i don't know how to log on to a google account

usually the path to a shared document is a string 44 characters long
it is quite secure
and almost impossible to guess