Please add sheets array to info
vimagick opened this issue ยท 3 comments
vimagick commented
This tool is very helpful. I want to automate a task by a URL like this:
https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit#gid={sheetId}
^^^^^^^^^^^^^ ^^^^^^^
Then I'll export this sheet to csv:
$ gsheet sheetInfo spreadsheetId
{
"sheets": [{...}, {...}, {...}]
}
# find title by sheetId
$ jq -r --argjson sheetId xxxxxxxxx '.sheets[].properties|select(.sheetId==$sheetId).title'
$ gsheet csv --id spreadsheetId --range 'sheetTitle'
Thanks!
Ref:
cristoper commented
Hi vimagick,
Are you able to try the sheetinfo branch (PR #9) and see if it works for your purposes? In particular the new gsheet title --id $SHEET_ID --sheetid $GID
command in that PR should make it easy to look up a sheet title from a sheet id in your script.
vimagick commented
Great! ๐
cristoper commented
I merged the new commands to master and released v0.1.3: