Board logo

标题: 请各位大虾帮忙写一个批处理(虽小,但可能较复杂) [打印本页]

作者: apogee     时间: 2004-6-17 00:00    标题: 请各位大虾帮忙写一个批处理(虽小,但可能较复杂)

功能为文本文件内容的转换.文件的每行都为 token1  spaces token2 spaces token3,也即空格分开的三段(不能以"." 为delims,因为其他行没有文件名).具体的转换如下:

... test.txt ...
... ...      ...
... test.txt ...
... ...      ...
... test.txt ...
        .
        .
        .


转换为:

... test1.txt ...
... ...       ...
... test2.txt ...
... ...       ...
... test3.txt ...
      .
      .
      .

我知道要用到 FOR /F "tokens=1,2*" in (content.txt) do command 之类的,
但我不知道批处理的语句怎么嵌套,还有数字的递加怎么处理.望前辈们指教,小生谢过了!