i need help,
i found this code to import csv in google sheets with apps script. it's work find but i'd like to import in another sheet to the same file.
i can't find the code to enter number ( gid ) of my sheet
function myFunction() {
function importData()
{
var ss = SpreadsheetApp.getActive();
var url = 'https://your-data-source.csv';
var text = UrlFetchApp.fetch(url).getContentText();
var csvData = Utilities.parseCsv(text);
var sheet = ss.getSheetByName('Sheet1');
for (var i = 0; i < csvData.length; i++) {
sheet.getRange(i+1, 1, 1, csvData[i].length).setValues(new Array(csvData[i]));
}
}
importData();
}
thanks