I'm currently trying to enclose an entire column in a Google Sheets CSV file in double quotes for a script that I'm writing. I've attached a link for the sample CSV sheet below:
UPDATED Ver:
I added a ternary operator which works if we'll be adding a single if-else like condition for arrow functions in javascript.
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getRange(1,2,sheet.getLastRow(),1);
var values = range.getValues();
var quoted = values.map(x => x.map(y => y[0] == '"' && y[y.toString.length] == '"' ? y : '"' y '"' ));
range.setValues(quoted);
}