本帖最后由 思想之翼 于 2014-8-21 14:24 编辑
@echo off
pushd "d:\文本\文本1\001\lishi\"
(for %%a in (wj循环*.txt) do (
if not "%%~za" == "0" (
type "%%a"
) else echo,
))>$
move $ "d:\文本\文件夹1\001.txt"
exit
@echo off
pushd "d:\文本\文本1\002\lishi\"
(for %%a in (wj循环*.txt) do (
if not "%%~za" == "0" (
type "%%a"
) else echo,
))>$
move $ "d:\文本\文件夹1\002.txt"
exit
......
@echo off
pushd "d:\文本\文本1\210\lishi\"
(for %%a in (wj循环*.txt) do (
if not "%%~za" == "0" (
type "%%a"
) else echo,
))>$
move $ "d:\文本\文件夹1\210.txt"
exit
合并上述210个BAT代码为:- @echo off
- setlocal enabledelayedexpansion
- for /l %%x in (1001,1,1210) do (
- set y=%%x
- pushd "d:\文本\文本1\!y:~1!\lishi\"
- (for %%a in (wj循环*.txt) do (
- if not "%%~za" == "0" (
- type "%%a"
- ) else echo,
- ))>$
- move $ "d:\文本\文件夹1\!y:~1!.txt"
- exit
复制代码 合并后的代码出错了,不知道错在哪里,望帮助查勘! |