I am new to Google Scripts and I want to replace the \n text in my cells with the newline character. I use this code:
for (var row = 0; row < data.length; row++) {
for (var col = 0; col < data[row].length; col++) {
var sValue = data[row][col];
sValue = sValue.toString().replaceAll("\n", String.fromCharCode(10));
//Set the new value:
var cell = sheet.getRange(row+1, col+1);
cell.setValue(sValue );
}
But it does nothing. The text is not changed. Any help here?