Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to convert csv to new spread sheet that doesn't exist in drive or import csv as sheet from Gmail [closed]

$
0
0

I want to convert csv file in drive to new sheet by this code:

function importCSVFromGoogleDrive() {var file = DriveApp.getFilesByName("data.csv").next();var csvData = Utilities.parseCsv(file.getBlob().getDataAsString());var sheet = SpreadsheetApp.getActiveSheet();sheet.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);}

but the result show:

TypeError: Cannot read property 'getRange' of null

How can I fix it or, is there any code can import csv as sheet from Gmail?


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>