Skip to content

Instantly share code, notes, and snippets.

@aborruso
Last active September 6, 2021 09:35
Show Gist options
  • Save aborruso/fab3e097301977182c757728b3d9bd4b to your computer and use it in GitHub Desktop.
Save aborruso/fab3e097301977182c757728b3d9bd4b to your computer and use it in GitHub Desktop.
function importCSVFromWeb() {
var csvUrl = "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-covid19-ita-regioni.csv";
var csvContent = UrlFetchApp.fetch(csvUrl).getContentText();
//csvContent.replace(/[ \t]+$/gm, ' ');
var csvData = Utilities.parseCsv(csvContent);
var sheet = SpreadsheetApp.getActiveSheet();
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1')
sheet.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment