PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 29, 2022

[FIXED] How to stop Google Drive from automatically saving csv's imported into a Google Sheets document

 August 29, 2022     csv, google-sheets     No comments   

Issue

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.


Solution

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.

  • removeFile(child)
  • moveTo(destination)
  • setTrashed(trashed)
  • Google Apps Script Deleting Google Drive Files in Folder Example


Answered By - PatrickdC
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing