I get a zipped csv file sent by email weekly and have written a google app script to get the file from email and save to drive:
// unzip it
var unzipblob = Utilities.unzip(att[z]);
// Create with a unique filename using date of email
var newName = 'provider_stats-' + Utilities.formatDate(date, 'GMT', 'yyyy-MM-dd') + '.csv';
// Save the first file (there's only one) in the zip
file = folder.createFile(newName, unzipblob[0].getDataAsString());
file.setDescription(newName);
This works fine, but I notice in the drive folder where I save it, it seems to have a different doc-type to the ones I did manually. The other ones offer me "Open in Google Sheets" as an option when I right-click, but not the one saved from the script.
Any idea how I can set the document type or format, so it can be opened directly in Google Sheets?
My next step is to save as a Google Sheet directly, so any help on that ahead of time would also count as an answer!