Answers for "google sheets export csv"

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 "google sheets export csv"

Code answers related to "Objective-C"

Browse Popular Code Answers by Language