0
如何通过此代码缩短时间? TE是包含我的文本的变量(包含超过20000行) 和s是我的搜索词。在文本文件中搜索单词
repeat with x = 0 to the number of lines in TE
if line x of TE contains s then
put line x-1 of TE & cr & line x of TE & cr & line x+1 of TE & cr & cr after dataarray
end if
end repeat
此代码工作正常,但它需要太多的时间。 如何减少时间?
如果myData中存在重复的行,lineOffset函数将仅查找第一个行,除非使用可选的第三个参数linesToSkip。 – Devin
是的,这是真的德文。当我有一点时我会更新代码。 – Mark
脚本现在已经更新 – Mark