With the switch to the new version of Google Sheets, the option to publish a specific worksheet and then access that as a CSV file has disappeared (hopefully just temporarily).
In the new Google Sheets, I managed to publish a worksheet as a CSV by piecing together answers from here and here.
This is how to do it:
- Share the Google Doc so anyone with the link can view (sadly this loses the granularity of only sharing specific sheets that used to exist in the old version).
- Publish the document (File > Publish to the Web) and look for the document ID in the URL
- Add that document ID into this URL in place of KEY:
- https://docs.google.com/spreadsheets/d/<KEY>/export?format=csv&id=<KEY>
- While editing your Google Doc, open the worksheet you want to export and look in the URL for the GID parameter
- Copy this GID parameter and append it to your URL:
- https://docs.google.com/spreadsheets/d/<KEY>/export?format=csv&id=<KEY>&gid=<GID>
Done
Thanks for the solution. I was looking for a workaround for quite some time now.
Cheers Mate
Nice. However, you do not need the GID, just repeat the for both key and &id=
The GID will target a particular worksheet in the spreadsheet (rather than just the first one), so it’s useful if you have a number of worksheets.
I was so happy to find this, I am trying to put a Google Sheet onto a Weebly custom page without the header.
Do I just need to insert the URL with the KEY and GID inserted, into ” x ” below?
Your csv does work. Cool. However, I am in need of xml or rss. Were you able to publish out to those file types?
I haven’t tested it, but you could try playing with the “format=csv” part of the URL to see if “xml” or “rss” works in place of “csv”. Let me know how you get on with it.
Hi Adam,
Many thanks for your solution, it works fine with
format=”csv”
format=”pdf”
format=”ods”
format=”xlsx”
format=”tsv”
but it doesn’t work with
format=”rss”
format=”json”
format=”xml”
Any idea to export to this format?
I can’t understand why this fomat has been abandoned.
Many thanks
jcv
Is it possible to export all sheets under one CSV? I have tried setting GID to 0 but that would only export the first sheet.
Thank you
just tried the full grid number like this gid=4167541856
Cheers
I tried this website http://www.tadalabs.com that allowed me to publish my google sheet on-line and use the csv file as a web database. Pretty interesting.