Reputation: 792
urlread fails to open a spreadsheet that is available for anyone with the link. It opens from a browser, but urlread gives this error:
octave:1> a=urlread('https://docs.google.com/spreadsheets/d/.../edit?usp=sharing'); error: urlread: curl: Peer certificate cannot be authenticated with given CA certificates
is there any way to import a Google spreadsheet into an octave program?
Upvotes: 1
Views: 947
Reputation: 76
This seems to work, but you need a link to the Google spreadsheet that anyone can view which I assume you have because the end of the URL you posted contains "sharing".
octave:1> urlwrite("https://docs.google.com/spreadsheets/d/.../export?format=csv", "filename.csv")
octave:2> a = load("filename.csv")
a =
1 23 4 5
1 6 3 7
1 6 6 7
Replace ...
with the ID of your Google spreadsheet.
The key component here is /d/.../export?format=csv
which specifies the download of the file as a csv. Google spreadsheets also supports several different filetypes if you don't want to use csv.
Upvotes: 3