批处理替换a.txt中的空格为逗号.这样写哪个地方不对?
@echooffsetlocalenabledelayedexpansionseti=1settfor/f"tokens=*delims="%%ain(1.txt)do(...
@echo off
setlocal enabledelayedexpansion
set i=1
set t
for /f "tokens=* delims=" %%a in (1.txt) do (
set ch=%%a
set ch=!ch: =,!
if %t%<>%ch% echo !ch!>>2.txt
else set %t%==%ch%
@echo %i%
set /a i=%i%+1
) 展开
setlocal enabledelayedexpansion
set i=1
set t
for /f "tokens=* delims=" %%a in (1.txt) do (
set ch=%%a
set ch=!ch: =,!
if %t%<>%ch% echo !ch!>>2.txt
else set %t%==%ch%
@echo %i%
set /a i=%i%+1
) 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询