回复 15# shniutan
写的有点乱,凑合用吧。bat文件存为ANSI编码:- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=7,12 delims=&= " %%i in (b.txt) do set #%%j=%%i
- (for /f "tokens=1* delims==" %%i in (a.txt) do echo,%%j)>Newfile.txt
- findstr /g:Newfile.txt c.txt>1.log
- (for /f "tokens=1* delims==" %%i in (1.log) do echo,%%j)>Newfile.txt
- for /f "tokens=1-5,7 delims=- " %%a in (Newfile.txt) do set /a "_%%a%%b%%c%%d%%e%%f+=1"
- (for /f "tokens=1-5,7 delims=- " %%a in (Newfile.txt) do (
- if not defined @%%a%%b%%c%%d%%e%%f (
- echo,%%f !#%%f! %%a-%%b-%%c-%%d-%%e !_%%a%%b%%c%%d%%e%%f!
- set /a Sum+=!_%%a%%b%%c%%d%%e%%f!
- )
- set @%%a%%b%%c%%d%%e%%f=true
- ))>1.log
- sort 1.log>Newfile.txt
- echo,Sum !Sum!>>Newfile.txt
- del 1.log
- pause
复制代码
|