本帖最后由 再世情緣 于 2019-9-13 00:21 编辑
- @echo off &color 0a &setlocal enabledelayedexpansion
- mode con cols=140 lines=32
- Rem 附件里面是Sec,你发的帖子里是Se,这里你自己斟酌
- set "var=D:\se\"
- pushd %var%
- Rem 下面一行是各列间距,最后一个是等待时间
- set /a l1=25,l2=9,l3=9,l4=6,l5=7,l6=8,l7=9,l8=11,l9=10,wts=100
- for /f "delims=" %%a in ('dir /b /a -d ".\se\wltj*.txt" 2^>nul') do (set "log=%var%se\%%~nxa")
- set /p code=<"!log!"
- for /f "tokens=5-10 delims= " %%a in ("!code!") do (set "code=%%a %%b %%c %%d %%e %%f")
- for /f "tokens=1,3,5,7,9,11 delims=/ " %%a in ("!code!") do (
- set "str=%%a %%b %%c %%d %%e %%f"
- set "str1=%%a"
- set "str2=%%b"
- set "str3=%%c"
- set "str4=%%d"
- set "str5=%%e"
- set "str6=%%f"
- )
- :loop
- for /f "delims=" %%a in ('dir /b /a -d /o:d ".\B*" 2^>nul') do (
- set "txt=%%~fa"
- set "tm=%%~ta "
- set "tm=!tm:~,%l1%!"
- set "txtn=%%~na"
- set "txtn=!txtn:~,4!"
- set "ipr="
- for /f "tokens=1 delims= " %%i in ('findstr /L /I "!txtn!" ".\se\ipref.txt" 2^>nul') do (set "ipr=%%i")
- if "#!ipr!#" EQU "##" set "ipr= - "
- set "jhr="
- for /f "tokens=1 delims= " %%i in ('findstr /L /I "!txtn!" ".\se\jhref.txt" 2^>nul') do (set "jhr=%%i")
- if "#!jhr!#" EQU "##" set "jhr= - "
- set "ipr=!ipr! " &&set "ipr=!ipr:~,%l2%!"
- set "jhr=!jhr! " &&set "jhr=!jhr:~,%l3%!"
- set /a "sum=0"
- for %%i in (%str%) do (
- set "%%i=0"
- set /a "num=0"
- for /f "delims=" %%x in ('findstr /L /I "%%i" "!txt!" 2^>nul') do (set /a "num+=1")
- set /a "sum+=num"
- set "%%i=!num! "
- )
- set "%str1%=!%str1%:~,%l4%!"
- set "%str2%=!%str2%:~,%l5%!"
- set "%str3%=!%str3%:~,%l6%!"
- set "%str4%=!%str4%:~,%l7%!"
- set "%str5%=!%str5%:~,%l8%!"
- set "%str6%=!%str6%:~,%l9%!"
- echo.!tm! !txtn! !ipr! !jhr! !%str1%! !%str2%! !%str3%! !%str4%! !%str5%! !%str6%! !sum! >>"!log!"
- echo.!tm! !txtn! !ipr! !jhr! !%str1%! !%str2%! !%str3%! !%str4%! !%str5%! !%str6%! !sum!
- Rem 删除文件
- del /q /f "!txt!" >nul
- )
- ping localhost -n %wts% >nul
- goto :loop
- call exit
复制代码
|