- cd \1aep
- set jobid=
- v:\run\echox -c 74 "%date%%time%孤立TXT处理标志位"
- for %%a in (*.txt) do (
- set list=%%a
- timeout -t 2 >nul
- for /f "tokens=1,2 delims=:. " %%i in ("!time!") do (
- if %%i lss 10 (set h=10%%i) else (set h=1%%i)
- if %%j lss 10 (set s=10%%j) else (set s=1%%j)
- set /a "sysTime=(!h!-100)*60+(!s!-100)"
- )
- for /f "tokens=4,5 delims=:-/ " %%j in ("%%~ta") do (set /a "fileTime=(1%%j-100)*60+(1%%k-100)")
- set /a dtime=!sysTime!-!fileTime!
- if !dtime! lss 0 (set /a dtime=!dtime:~1!)
- if !dtime! gtr !zhi! (
- echo 系统时间:!sysTime! 文件时间:!fileTime! 间隔:!dtime! 发现孤立文件!!list!
- for /f "tokens=1,2,* delims==" %%a in ('findstr /ibc:"num" !list!') do (set num=%%b)
- for /f "tokens=1,2,* delims==" %%a in ('findstr /ibc:"lab" !list!') do (set aepname=%%b)
- for /f "tokens=1,2,3,4,5,6,7,8 delims=\" %%q in ('findstr /ibc:"Path" !list!') do (set ppath=%%u)
- for /l %%a in (1,1,!num!) do (
- for /f "tokens=1,* delims==" %%a in ('findstr /c:"JobID%%a" %aepath%\!list!') do (set jobid=%%b)
- echo AEP文件名:!aepname! 订单号:!ppath! 任务数:!num!
- call :fenxi
- )
- )
- )
- goto 4th
复制代码 代码本身有一个问题:当符合条件的文件和不符合条件的文件都存在的时候,这段代码会把不符合条件的文件名也送入fenxi子过程。
应该怎么调整呢? |