You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an option updateExistingCsvFiles to overwrite or replace existing CSV files with the same name in the target Drive folder when a new CSV file with the same name is to be uploaded.
Implementing this new feature would require using the files.update method of the Drive API and an additional process to check the contents of the existing csv folder to see whether a particular CSV file already exists in the target Drive folder.
When saveOriginalFilesToDrive is set to true in the c2g.config.json config file, the original CSV file is uploaded to the child folder named csv under the target Google Drive folder.
In the current settings, CSV files in the csv are newly created (uploaded) on every run REGARDLESS of the existence of CSV files with the same name. So if you are using csv2gsheets in a situation where you have a batch process to convert & upload CSV files with unchanging file names, you would be creating a new CSV file with the same file name as previous runs every time you run the command. The only way to distinguish between such CSV files will be to look at their Created at date-time values.
On the other hand, some users might expect the CSV files uploaded to the Drive folder to be REPLACED with the newer version instead of creating a new one when a CSV file with the same name already exists, especially if they have set updateExistingGoogleSheets, i.e., the option to update existing Google Sheets files with the same name, to true.
When adding this new option, updateExistingCsvFiles, we should set the default value to false for backward compatibility.
The text was updated successfully, but these errors were encountered:
Add an option
updateExistingCsvFiles
to overwrite or replace existing CSV files with the same name in the target Drive folder when a new CSV file with the same name is to be uploaded.Implementing this new feature would require using the
files.update
method of the Drive API and an additional process to check the contents of the existingcsv
folder to see whether a particular CSV file already exists in the target Drive folder.See: Method: files.update | Google Drive | Google for Developers
Some background
When
saveOriginalFilesToDrive
is set totrue
in thec2g.config.json
config file, the original CSV file is uploaded to the child folder namedcsv
under the target Google Drive folder.In the current settings, CSV files in the
csv
are newly created (uploaded) on every run REGARDLESS of the existence of CSV files with the same name. So if you are usingcsv2gsheets
in a situation where you have a batch process to convert & upload CSV files with unchanging file names, you would be creating a new CSV file with the same file name as previous runs every time you run the command. The only way to distinguish between such CSV files will be to look at theirCreated at
date-time values.On the other hand, some users might expect the CSV files uploaded to the Drive folder to be REPLACED with the newer version instead of creating a new one when a CSV file with the same name already exists, especially if they have set
updateExistingGoogleSheets
, i.e., the option to update existing Google Sheets files with the same name, totrue
.When adding this new option,
updateExistingCsvFiles
, we should set the default value tofalse
for backward compatibility.The text was updated successfully, but these errors were encountered: