回复 10# terse - @echo off
- cls
- for /l %%i in (1,1,3) do echo.
- color 1A
- ECHO ┏━━━━━━━━━━━━━━━━━━━━┓
- ECHO ┃ ┃
- ECHO ┏━━━━┫ 当前选择: 有规则程序自动合成 ┣━━━━┓
- ECHO ┃ ┃ ┃ ┃
- ECHO ┃ ┗━━━━━━━━━━━━━━━━━━━━┛ ┃
- echo ┃ ==处理说明↓== ┃
- echo. ┃ ┃
- ECHO ┃ ┗━━直接按回车默认选择“==NC==”文件夹处理━━┛ ┃
- echo. ┃ ┃
- echo. ┏------------------------------------------------------------┓
- echo ┣ ★★★★★★====默认选择==NC==处理。====★★★★★★ ┫
- echo. ┗------------------------------------------------------------┛
- echo. ┃ ┃
- echo. ┣= 请保证该所有程序内刀具无重复即可完成处理= 【0查看说明】 ┫
- echo. ┃ ┃
- set /p DJFL=
- IF /I '%DJFL%'=='0' GOTO zdhcsm
- echo ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
- echo ┃ ===正在处理...以下为刀具信息!==== ┃
- pushd "==NC==\"
- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1,2* delims=:" %%i in ('findstr /ic:"TOOL NAME = " /c:"(Cutter Name:" /c:"( DIA. = " /c:"( Dia:" /c:"(Tool Name:" *.nc') do (
- if "!%%i!" == "" (
- set "str="
- if "%%k" == "" for /f "tokens=2-6 delims==,)" %%a in ("%%j") do (
- if "%%c" =="" (
- set D=%%a&set "R=%%b"
- ) else set D=%%c&set "R=%%e"
- ) else for /f "tokens=1-6 delims=:) " %%a in ("%%k") do (
- if "%%d" neq "" (
- set D=%%a&set "R=%%d"
- ) else set "str=%%a"
- )
-
- if "!str!" == "" for %%f in (D R) do for /f %%h in ("!%%f!") do (
- set "%%f=%%h"
- for /l %%e in (1 1 6) do (
- if "!%%f:~-1!" == "0" set "%%f=!%%f:~,-1!"
- )
-
- if "!%%f!" neq "0." (
- if "!%%f:~-1!" == "." set "%%f=!%%f:~,-1!"
- if "!%%f!" neq "" set "%%f=%%f!%%f!"
- ) else set "%%f="
- set "str=!D!!R!"
- )
- ::==========================修正DxRx==========================
- set strD=!str:~0,1!
- if "!strD!" equ "R" (
- for /f "tokens=1 delims=R" %%h in ("!str!") do set /a strJS=%%h*"2"
- set str=D!strJS!!str!
- )
- ::==========================此为按规则合并参数========================
- md "!str!" 2>nul
- set "f=%%~ni"
- set "f=!f:~-2!"
- set s=-G
- for %%a in (A R1 F1 -1) do if "!f:%%a=!" neq "!f!" set "s="
- if not exist "1-!str!!s!.lat" cd.>"1-!str!!s!.lat"
-
- %1 (for /f "tokens=*" %%l in ('%0 : ^|sort') do echo %%l)&pause&exit
- for /f "tokens=* delims=:" %%l in ('findstr /ic:G54.1P %%i') do (
- set "str=%%l"
- set str=!str:*G54.1P=!
- for /f "delims=G " %%l in ("!str!") do set "str= %%l"
- echo !str:~-5! %%i>>1-!str!!s!.lat
- )
- )
- )
- echo ┠──────────────────────────────┨
- echo ┃ ===【刀具分类模拟完成!】=== ┃
- ECHO ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
- pause
复制代码 是 %1 (for /f "tokens=*" %%l in ('%0 : ^|sort') do echo %%l)&pause&exit 这段代码吗?出现内部命令。。。还是不明白这段代码的工作原理。可以给个相关资料看看么?谢谢。代码很深奥 呵呵。 |