本帖最后由 xxpinqz 于 2015-2-16 09:38 编辑
- @echo off
- cd /d "d:\数据1\"
- for %%i in (*.txt) do (
- setlocal enabledelayedexpansion
- (for /f "delims=" %%a in (%%i) do (
- for %%b in (1%%a) do set/a x=%%b/100%%10,y=%%b/10%%10,z=%%b%%10
- set/a #!x!+=1,#!y!+=1,#!z!+=1
- )
- for /l %%a in (0,1,9) do (
- set/a t=9-%%a
- if defined #%%a (
- set "str=000000!#%%a!$!t!"
- set "$!str:~-8!=%%a"
- ) else set "off=!off!%%a"
- )
- for /f "tokens=2 delims==" %%a in ('set $^|sort /r') do set "on=!on!%%a"
- echo,!on!!off!
- )>"d:\数据2\%%i"
- endlocal
- )
复制代码
|