想實現對多層文件中的某些指定數據的處理
如下:
一級目錄
二級目錄
三級目錄
對所有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是三個用於特定圖像信息處理的程序