Import data from google sheets to matlab

226 vues (au cours des 30 derniers jours)
Hüseyin Cagdas Yatkin
Hüseyin Cagdas Yatkin le 12 Déc 2019
Commenté : thierry Lanoe le 25 Mar 2023
Hello guys,
I wanted to import data from google sheets to matlab. However I couldn't find any information about it. Since the google sheets always geting update I can't just copy and paste so I wanted to import new data for every time I run the matlab script. Is there a way?
Thanks in advance.
  1 commentaire
Vinicio Moya
Vinicio Moya le 26 Juin 2020
Did you resolve it?

Connectez-vous pour commenter.

Réponses (3)

Donald
Donald le 4 Mar 2021
First, find the ID for your Sheet. It's the long string if you look at the URL. For example,
http s://docs.google.com/spreadsheets/d/bladjaljd77442n2j3ljk2j3j2jdkdjad/edit#gid=1498695871
Then it's easy
ID = 'bladjaljd77442n2j3ljk2j3j2jdkdjad'
sheet_name = 'My Sheet';
url_name = sprintf('https://docs.google.com/spreadsheets/d/%s/gviz/tq?tqx=out:csv&sheet=%s',...
ID, sheet_name);
sheet_data = webread(url_name);
  4 commentaires
Umair Mughal
Umair Mughal le 21 Déc 2021
That's really great, but doesn't work for protected sheets. The url returns the html content of google login page
thierry Lanoe
thierry Lanoe le 25 Mar 2023
is there a solution with "protected sheets"

Connectez-vous pour commenter.


Hiro Yoshino
Hiro Yoshino le 12 Déc 2019
  1 commentaire
Hüseyin Cagdas Yatkin
Hüseyin Cagdas Yatkin le 12 Déc 2019
I think this is for the offline files, I want to take from online source which is specifically google sheets.

Connectez-vous pour commenter.


dimuthu chathuranga
dimuthu chathuranga le 9 Avr 2021
I have same problem please help me I want to real time uptade data fron google sheet to mathlab gui

Catégories

En savoir plus sur Google dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by