Board logo

标题: [文本处理] 随机批处理的问题求助 [打印本页]

作者: shuaige100    时间: 2015-7-17 13:09     标题: 随机批处理的问题求助

本帖最后由 shuaige100 于 2015-7-17 13:11 编辑
  1. @echo off &setlocal enableDelayedExpansion
  2. for /f "tokens=1* delims=:" %%a in ('findstr/rvxc:" *" "1.txt"^|findstr/n .')do set "#%%a=%%b"&set/a n+=1
  3. set/a "c=%random%%%n+1"
  4. call set c=%%#%c%%%
  5. echo %c%
  6. for /f "tokens=1* delims=:" %%d in ('findstr/rvxc:" *" "2.txt"^|findstr/n .')do set "g%%d=%%e"&set/a n+=1
  7. set/a "f=%random%%%n+1"
  8. call set f=%%g%f%%%
  9. echo %f%
  10. for /f "tokens=1* delims=:" %%h in ('findstr/rvxc:" *" "3"^|findstr/n .')do set "i%%h=%%j"&set/a n+=1
  11. set/a "k=%random%%%n+1"
  12. call set k=%%i%k%%%
  13. echo %k%
  14. pause >nul
复制代码
第一个txt可以echo,2txt,很经常ECHO 处于关闭状态,3.txt直接echo %j了,如何修改呢?




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2