本帖最后由 pcl_test 于 2016-11-27 16:45 编辑
1、补位- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /a-d/b *.lrc') do (
- set "fn=000000000000%%~na"
- set "#!fn:~-10!=%%a"
- )
- for /f "tokens=1* delims==" %%a in ('set #') do echo;%%b
- pause
复制代码 2、第三方sort http://www.bathome.net/s/tool/index.html?key=sort复制代码 3、结合其他脚本语言- powershell -c "dir *.lrc|?{$_.BaseName -match '^\d+$'}|sort {[int]$_.BaseName}|%%{$_.Name}"
- pause
复制代码
- 1>1/* :
- @echo off
- dir /a-d/b *.lrc|cscript -nologo -e:jscript "%~f0"
- pause&exit
- */
-
- WSH.Echo(WSH.StdIn.ReadAll().split(/[\r\n]+/).sort(function(a,b){
- return Number(a.replace(/(.+\\\D*)?(\d+)(\.[^\.\\]+$)?/,'$2'))-Number(b.replace(/(.+\\\D*)?(\d+)(\.[^\.\\]+$)?/,'$2'))
- }).join('\r\n'))
复制代码
|