本帖最后由 xxpinqz 于 2016-8-7 16:39 编辑
忘了差不多了。。。。- @echo off&setlocal enabledelayedexpansion
- ::下一行50表示最大值,自己改
- for /l %%a in (50,-1,1) do set "c=!c!,%%a,"
- (for /f "delims=" %%a in ('dir /b/s *-*.txt') do (
- set "str=%%~na"
- set "str=!str:-=.1!"
- for /f "delims=" %%b in ("!str!") do (
- set "n=%%~xb"
- set/a "1/(!n:.=!-1)" && (
- if not defined #%%~nb (
- set #%%~nb=.
- if !max! gtr 0 for %%c in (!max!) do (
- set num=!num:*,%%c,=!
- if not "!num!"=="" echo,!file:.1=-!!num:,= !
- )
- set num=%c%
- set "file=%%~dpnb文件缺少:"
- set max=0
- )
- set n=!n:~2!
- for %%c in (!n!) do set num=!num:,%%c,=!&if %%c gtr !max! set/a max=1+%%c
- )||echo,%%a----错误
- )))2>nul
- if !max! gtr 0 for %%c in (!max!) do (
- set num=!num:*,%%c,=!
- if not "!num!"=="" echo,!file:.1=-!!num:,= !
- )
- pause
复制代码
|