Last active
June 19, 2020 18:19
-
-
Save volandku/6b02a49eabde8107b1d5fe8ddaa6c4ac to your computer and use it in GitHub Desktop.
Google Sheet замена текста в ячейках
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @OnlyCurrentDoc */ | |
function ChangeIt() | |
{ | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
//var cell = sheet.getRange('A1:D7'); | |
var cell =sheet.getDataRange(); | |
cell.setValues(cell.getValues().map(blackBox_)); | |
} | |
function blackBox_(row){ | |
return row.map(blackFox2_); | |
} | |
function blackFox2_(cell) | |
{ | |
console.log(cell); | |
if (typeof cell.replace === "function") { return cell.replace("Да (часто)","2").replace("Иногда (частично)","1").replace("Нет (никогда)","0");} | |
else { return cell;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment