Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 如何用应用程序脚本查找和替换字符?_Google Apps Script_Google Sheets - Fatal编程技术网

Google apps script 如何用应用程序脚本查找和替换字符?

Google apps script 如何用应用程序脚本查找和替换字符?,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我想找到这个角色的每一个实例(例如)™) 在一个名为“SF”的特定Google工作表中,将其从工作表中删除 到目前为止,我能够将其从该表中的特定范围(即J:J)中移除,但希望该范围为(a:AT) 请告知我的函数在处理某个范围时的错误位置 函数CleanInputs(){ var sf=SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“sf”); var范围=sf.getRange(“J:J”); //查找并替换Screamingfrog

我想找到这个角色的每一个实例(例如)™) 在一个名为“SF”的特定Google工作表中,将其从工作表中删除

到目前为止,我能够将其从该表中的特定范围(即J:J)中移除,但希望该范围为(a:AT)

请告知我的函数在处理某个范围时的错误位置

函数CleanInputs(){
var sf=SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“sf”);
var范围=sf.getRange(“J:J”);
//查找并替换Screamingfrog中的字符编码问题
range.setValues(range.getValues().map)函数(行){
返回[行[0]。替换(/行)™/, "")];
}));
}
使用和:

function myFunction() {
  const sheetName = "SF";
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sh = ss.getSheetByName(sheetName);
  sh.createTextFinder("’").replaceAllWith("");
}