Extremely in-experienced coder here, I want to run a regex function that searches for a set of words in a google sheet populated with transcripts, then export, I guess, the results into a new sheet.
(我在这里经验不足的编码员,我想运行一个正则表达式函数,该函数在填充了成绩单的Google工作表中搜索一组单词,然后将结果导出到新工作表中。)
I have a script that does what I want but only shows the results of the regex function in the logs, ie, it pastes the entire transcript that contains the target words.
(我有一个脚本可以执行我想要的操作,但只在日志中显示regex函数的结果,即,它将粘贴包含目标词的整个脚本。)
I would like to show the results in an actual sheet rather than in the logs.(我想在实际工作表中而不是在日志中显示结果。)
Any feedback would be really helpful, but I would ask you give feedback like you would to a 5 year old, as I said, extremely in-experienced coder here.
(任何反馈都将真正有帮助,但是我想请您像我说的那样对5岁的程序员提供反馈,就像我在这里经验不足的编码器一样。)
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var history = ss.getSheetByName('sheet1');
ss.setActiveSheet(history);
for(i = 1; i <= history.getMaxRows(); i += 1) {
var r = history.getRange('A' + i)
var regexp = /W*(identity)W*s+(w+s+){0,5}(verification)|(verification)s+(w+s+){0,5}(identity)/
if (regexp.exec(r.getValue()) !== null ) {
Logger.log(r.getValue())
}
}
}
ask by Joseph Davitt translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…