Home > Software engineering >  How to stop Google Sheets automatically saving downloaded CSV files to Google Drive
How to stop Google Sheets automatically saving downloaded CSV files to Google Drive

Time:11-21

In my daily workflow I frequently download from Google Sheets in CSV format to the downloads folder on my PC (i.e. my physical hard drive). However, Google Sheets also automatically saves a copy in the root of my Google Drive (i.e. in the cloud).

I don't want a copy of the CSV I downloaded to my hard drive to be also saved to my cloud drive. It means I have to waste hours of time deleting those files from the Google Drive root folder each month, as they're redundant copies of what's on my hard drive.

I've contacted Google Workspace support and apparently this is default behaviour! Has anyone found a solution/workaround to this problem?

CodePudding user response:

The only way you can download a Sheet to csv format without making copy to Google Drive is by using URL method.

Copy this URL to your browser and replace the SpreadsheetID and GID. (make sure to remove the braces).

https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export?format=csv&gid={GID}
  • SpreadsheetID - Can be found in the URL. This can be found after /d/ or before /edit

  • GID - Is the id of Sheet in Spreadsheet. Can be found in the last part of the url. example gid=0, 0 is the gid. This changes value when you switch Tab or Sheet in your Spreadsheet.

Example URL:

https://docs.google.com/spreadsheets/d/spreadsheetId/edit#gid=0

You can integrate this to Apps Script and create a Custom Menu if you are only using 1 sheet to import the data or create Add-on under your Workspace if you need this on multiple Sheets.

Reference:

  • Related