Board logo

标题: [文本处理] 批处理怎样批量生成指定文本内容? [打印本页]

作者: dresu    时间: 2014-12-2 11:17     标题: 批处理怎样批量生成指定文本内容?

批量生成txt文本!

内容是
article/number.html
article/number.html
article/number.html

数字如上,第一行number数字比第二行的大一个数,比第三行小一个数,文件名为第一行数字.txt

比如内容是:
article/9.html
article/8.html
article/10.html

文件名为9.txt

最好批量的!谢谢了
作者: DAIC    时间: 2014-12-2 12:44

  1. @echo off
  2. setlocal enabledelayedexpansion
  3. for /l %%i in (1,1,5) do (
  4.     set /a n=%%i+2
  5.     echo !n!
  6.     (for /l %%j in (%%i,1,!n!) do (
  7.         echo article/%%j.html
  8.     ))>%%i.txt
  9. )
复制代码





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