有三个文件,
a;A
b;B
c;C
d;D
This is lower case:[lower]
This is upper case:[upper]
- test.bat 是用来创建以config.txt文件中第一列为命名的txt文件,这些文件的内容模板是source.txt,然后把创建好的文件中的[lower],[upper]用config.txt的相应行来替换。如a.txt的内容为:
This is lower case:a
This is upper case:A
test.bat的使用格式是:test.bat config.txt source.txt 其内容为:
- @echo off
- setlocal EnableDelayedExpansion
- md tempfolder
- for /f "tokens=1,2 delims=;" %%i in (%1) do (
- for /f "delims=" %%m in (%2) do (
- set temp=%%m
- @echo %%i
- @echo %temp%
- @echo %temp:[lower]=%%i%>>tempfolder\i%%.txt
- )
- )
复制代码
这个例子并没有实现我想要的结果。特别是红色标注的两句,不知道错在那里,还请仔细分析指出。谢谢。
[ 本帖最后由 z_l_106 于 2010-5-12 17:47 编辑 ] |