本帖最后由 xxpinqz 于 2014-7-25 15:20 编辑
回复 6# 思想之翼 - @echo off
- cd /d "e:\123\文件夹1"
- (for %%i in (*.txt) do (
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in (%%i) do (
- for %%b in (%%a) do (
- if not defined #%%b set #%%b=100000
- set/a #%%b+=1
- )
- )
- (for /f "tokens=2" %%z in ('^(for /f "tokens=1-2 delims=#=" %%a in ^('set #'^)do @echo,%%b %%a^)^|sort /r') do set/p=%%z )>"文件夹2\%%i"
- endlocal
- ))<nul
复制代码
|