Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add sheets array to info #8

Closed
vimagick opened this issue Apr 28, 2024 · 3 comments
Closed

Please add sheets array to info #8

vimagick opened this issue Apr 28, 2024 · 3 comments
Assignees

Comments

@vimagick
Copy link

vimagick commented Apr 28, 2024

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:

@vimagick vimagick changed the title Please add option to accept a sheet_id Please add option list all sheets Apr 28, 2024
@vimagick vimagick changed the title Please add option list all sheets Please include sheets info Apr 28, 2024
@vimagick vimagick changed the title Please include sheets info Please add sheets array to info Apr 28, 2024
@cristoper cristoper self-assigned this May 2, 2024
@cristoper
Copy link
Owner

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
Copy link
Author

Great! 👏

@cristoper
Copy link
Owner

I merged the new commands to master and released v0.1.3:

https://github.com/cristoper/gsheet/releases/tag/v0.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants