我正在尝试运行将执行功能的代码,只是继续循环而不等待执行的功能完成。像这样的东西:
var jobSpec = {
configuration: {
load: {
destinationTable: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
},
allowJaggedRows: true,
writeDisposition: 'WRITE_TRUNCATE',
allowQuotedNewlines: true,
schema: {
fields: [
{name: 'User_id', type: 'STRING'},
{name: 'Email', type: 'STRING'},
{name: 'Comments', type: 'STRING'},
]
}
}
}
};
var spreadsheet = SpreadsheetApp.openById(fileId);
var MAX_ROWS = 50000;
var sheet = spreadsheet.getSheetByName("test");
var data = sheet.getDataRange().getValues();
var csvdata = "";
for (var row = 1; row < data.length && row < MAX_ROWS + 1; row++) {
for (var col = 0; col < data[row].length; col++) {
var cell = data[row][col].toString();
if (cell.indexOf(",") != -1) {
csvdata += "\"" + cell + "\"";
} else {
csvdata += cell;
}
if (col < data[row].length - 1) {
csvdata += ",";
}
}
csvdata += "\r\n";
}
我不需要processData函数来阻止我的代码。我只想执行它,然后继续其余的代码,因此继续循环。