Answers for "export single csv in google sheets"

0

google sheets script sample export csv file in C drive

function convertRangeToCsvFile_(csvFileName, sheet) {
  try {
    var data = sheet.getDataRange().getDisplayValues();
    if (data.length > 1) {
      var rows = [];
      data.forEach(row => {
        var cols = [];
        row.forEach(col => {
          cols.push(`"${col.replace(/"/g, '""')}"`);
        });

        rows.push(cols.join(','));
      });
      
      return rows.join('\n');
    }
  } catch(err) {
    Logger.log(err);
    Browser.msgBox(err);
  }
}
Posted by: Guest on April-12-2021

Code answers related to "export single csv in google sheets"

Code answers related to "Objective-C"

Browse Popular Code Answers by Language