因为在你的代码中,for语句是逐行解析文本的,所以,如果用的代码来过滤指定目录的记录的话,你的 %dati%_9.txt 中有多少行,find %dati%_6.txt /v /i "%%a">>%dati%_5.txt 语句就执行了多少次,你应该换一种过滤方案才能从根本上解决问题。
刚才在测试的过程中,发现高级搜索下面不搜索某些特定路径的选择中,只能选y,而不能选n,选n就提示说是无效操作,这是因为你没有对选n时作跳转导致的;选择完毕之后,尚未按任意键执行下一步,就已经生成了很多临时文件,这个属于操作时机过早,应该在按任意键之后才开始生成;并且搜索完毕之后,成功提示中的路径名是错误的;
今天就暂时测试到这个地方,改天再全面地测试一下——代码越来越多了,看起来也有点吃力,特别是碰到表述不清的地方,请你注意修改提示语言,使它既简洁又准确,不让让别人产生误解。
for /f "tokens=* delims= " %%a in (%dati%_9.txt) do (find %dati%_6.txt /v /i "%%a">>%dati%_5.txt)
Because in your code, the for statement parses the text line by line. So, if you use the code in to filter records in the specified directory, how many lines are there in your %dati%_9.txt, the find %dati%_6.txt /v /i "%%a">>%dati%_5.txt statement will be executed that many times. You should change to another filtering solution to fundamentally solve the problem.
Just now during the testing process, it was found that in the option of not searching certain specific paths under the advanced search, you can only select y, but not n. Selecting n prompts that it is an invalid operation. This is because you did not make a jump when selecting n; after the selection is completed, a lot of temporary files have been generated before pressing any key to execute the next step. This belongs to the operation being too early, and it should start generating only after pressing any key; and after the search is completed, the path name in the success prompt is wrong;
Today I will temporarily test here. I will test comprehensively another day - the code is getting more and more, and it looks a bit difficult, especially when encountering unclear expressions. Please pay attention to modifying the prompt language to make it both concise and accurate, and not let others have misunderstandings.
for /f "tokens=* delims= " %%a in (%dati%_9.txt) do (find %dati%_6.txt /v /i "%%a">>%dati%_5.txt)