I often make spreadsheets in Google Sheets by importing a collection of csv files. But whenever I import a csv file into a Google Sheets document, the csv file is uploaded to my Google Drive as well.
As a result, I have a huge number of csv files in my Google Drive that I don't want.
Can I stop this from happening? I want to import the csv into the Google Sheets document but I don't also need the csv file in my Google Drive.
A follow-up question is: if I can't prevent the csv from being uploaded to my drive, can I delete the csv from my drive without affecting the Google Sheets document?
This question is related to this one How to stop Google Sheets automatically saving downloaded CSV files to Google Drive, but they asked the question incorrectly, and never followed up with a corrected question.
CodePudding user response:
The CSV files being uploaded to the Google Drive is necessary. It is due to the fact that Google Sheets will only look for the source files to be imported either from your personal Google Drive or from other people's Google Drive that are shared with you.
Suggestion
As for your issue on multiple csv files, you can create a script to automatically delete csv files from your Google Drive. However, the only available feature in Google Apps Script is to move the said files to a folder using the File.moveTo(destination)
function since the removeFile(child)
function was already deprecated. Afterwards, you may use the setTrashed(trashed)
function to send the files to the trash folder.
References:
You may view the following links for further details on how to apply the suggestion.