bat 批处理 循环,替换

@echo off&setlocal enabledelayedexpansion
set hanye=AP:BKH-CNQ-TWP NA:NYK-CAN EU:LOH-TIM
for %%a in (%hanye%) do (
for /f "tokens=1,2 delims=:" %%i in ("%%a") do (
set  gu=%%i
set  xing=%%j
rem 替换-为空格
set xing=!xing:-= !

for %%k in (!xing!) do (
set  site=%%k
echo 周长:!gu! 面积:!site!
)
)
)
pause

你可能感兴趣的:(bacth)