批处理问题求助!
这个是a.txt文档当中的三个词最后重新组合成新的词组,但是这个现在之只能在cmd.exe中显示,我想把显示结果在b.txt中输出应该怎么改@echooff&setloc...
这个是a.txt文档当中的三个词最后重新组合成新的词组,但是这个现在之只能在cmd.exe中显示,我想把显示结果在b.txt中输出应该怎么改
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (a.txt) do set /a n+=1 & set ".!random!.!n!=%%a"
for /f "tokens=2delims==" %%a in ('set .') do (
set "str=!str!_%%a"
set /a "m+=1,1/(m%%3)" 2>nul||(echo,!str:~1!&set "str=")
)
if defined str echo,!str:~1!
pause
纯小白 请教下这上面怎么在b.txt中输出 展开
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (a.txt) do set /a n+=1 & set ".!random!.!n!=%%a"
for /f "tokens=2delims==" %%a in ('set .') do (
set "str=!str!_%%a"
set /a "m+=1,1/(m%%3)" 2>nul||(echo,!str:~1!&set "str=")
)
if defined str echo,!str:~1!
pause
纯小白 请教下这上面怎么在b.txt中输出 展开
2个回答
展开全部
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (a.txt) do set /a n+=1 & set ".!random!.!n!=%%a"
for /f "tokens=2delims==" %%a in ('set .') do (
set "str=!str!_%%a"
set /a "m+=1,1/(m%%3)" 2>nul||(echo,!str:~1!&set "str=")>>b.txt
)
if defined str echo,!str:~1!>>b.txt
pause
修改添加两处 >>b.txt,具体我已经修改了.请测试.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询