Skip to content

Instantly share code, notes, and snippets.

@alexismp
Last active June 11, 2019 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexismp/48c6a515db407f5ae53d46b6be15e0a3 to your computer and use it in GitHub Desktop.
Save alexismp/48c6a515db407f5ae53d46b6be15e0a3 to your computer and use it in GitHub Desktop.
Cloud Function csv2sheet - Part 1
const {google} = require("googleapis");
const {Storage} = require("@google-cloud/storage")
exports.csv2sheet = async (data, context) => {
var fileName = data.name;
// basic check that this is a *.csv file, etc...
if (!fileName.endsWith(".csv")) {
console.log("Not a .csv file, ignoring.");
return;
}
// define name of new sheet
const sheetName = fileName.slice(0, -4);
// TODO!
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment