function run() {
const book = SpreadsheetApp.getActiveSpreadsheet();
const sheet = book.getSheetByName('Пример 1');
sheet.sort(5);
const values = sheet.getDataRange().getValues();
const buffer = {
value: values[values.length - 1][4]
};
values.forEach((_, i, arr) => {
const j = arr.length - 1 - i;
const value = arr[j][4];
if (value !== buffer.value) {
sheet.insertRowAfter(j + 1);
buffer.value = value;
}
});
}
private void Awake() { if (instance == null) instance = null; else Destroy(gameObject); }