想实现对多层文件中的某些指定数据的处理
如下:
一级目录
二级目录
三级目录
对所有lane文件夹下的所有cyc文件夹中的所有R001C002图像进行处理
可以使用父bat与子bat文件进行处理
子bat文件(test5.bat)代码如下:
@echo off setlocal enabledelayedexpansion SET Obj_Length=13 SET index=0 for %%b in (%*) do ( SET Obj[!index!]=%%b SET /a index+=1 ) SET ImagePath=%Obj[9]% SET StartCyc=%Obj[0]% SET EndCyc=%Obj[1]% SET startR=%Obj[2]% SET endR=%Obj[3]% SET startC=%Obj[4]% SET endC=%Obj[5]% SET imageR=%Obj[6]% SET imageC=%Obj[7]% SET Nthroshold=%Obj[8]% set "Lanepath=0" set "Temp=0" set "TempStr=Lane" set "iLane=0" set "iCyc=0" set "inputfile=0" if not exist %ImagePath%\Crosstalk_Fit md %ImagePath%\Crosstalk_Fit for /f %%a in ( 'dir /b /o:n %ImagePath%') do ( rem echo %%a|findstr "^Lane" >nul set "Lanepath=%%a" set "Temp=!Lanepath:~-6,4!" if !Temp! EQU !TempStr! ( set "iLane=!Lanepath:~-2!" for /L %%b in (%StartCyc%,1,%EndCyc%) do ( for /L %%r in (%startR%,1,%endR%) do ( for /L %%c in (%startC%,1,%endC%) do ( if %%b LSS 10 ( SET "iCyc=00%%b" ) if %%b GEQ 10 ( SET "iCyc=0%%b" ) set "inputfile=%ImagePath%\Lane!iLane!\Cyc!iCyc!\intsFile_!iCyc!.txt" IntsExtraction.exe %ImagePath%\Lane!iLane!\Cyc!iCyc! %%r %%r %%c %%c %imageR% %imageC% if %errorlevel%==0 ( Correction_NN_Std.exe %ImagePath%\Crosstalk_Fit\Fit_Lane!iLane!_%Nthroshold%.csv !inputfile! !iCyc! %%r %%c %Nthroshold% TaskRead.exe -f !inputfile! ren "result.png" "CrossFile_Lane!iLane!_Cyc!iCyc!_R%%rC%%c.png" move "CrossFile_Lane!iLane!_Cyc!iCyc!_R%%rC%%c.png" %ImagePath%\Crosstalk_Fit ) ) ) ) ) )
父bat文件代码如下:
:: call 子bat文件名 StartCyc EndCyc stsrtR endR startC endC Nthroshold 输入路径
call test5.bat 1 1 2 2 2 2 1024 1024 0.1 V:\FJC\202002281802_B044_20200225A_FJC_hot_Tre_CK_Tre_DTT\Imagefile
注:IntsExtraction.exe,Correction_NN_Std.exe,TaskRead.exe是三个用于特定图像信息处理的程序
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类