Google Apps Script で外部のCSVファイルをシートに書き出す

    var response = UrlFetchApp.fetch("http://www.sample.com/sample.csv");
    var data = response.getContentText();
    var spreadsheetObj = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = spreadsheetObj.getSheetByName("csv");
    var csv = Utilities.parseCsv(data);
    sheet.getRange(1, 1, csv.length, csv[0].length).setValues(csv);