The file I want to import into the Google Sheets is from the website http://www.nasdaq.com/symbol/newl/historical. Under Select the Timeframe, I want 6 months. The actual CSV file is at the bottom of the page where it says "Download this file in Excel format."
I have tried:
var data = Utilities.parseCsv(unescape(encodeURIComponent(UrlFetchApp.fetch(url).getContentText().toString())));
var lastRow = sheet.getLastRow();
for (var i = 1; i < data.length; i++) {
sheet.getRange(i + lastRow, 1, 1, data[i].length).setValues(new Array(data[i]));
Apparently the url fetches an HTML file, not the CSV I want.