不保证通用
先读取A.txt
a.txt 内容 如下格式
20151001 1.csv 3.csv
20151002 1.csv 3.csv- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1*" %%a in (a.txt) do (
- for %%i in (%%b) do (
- set "cp="
- for /d %%j in (%%a-*) do (
- if exist "%%j\%%i" set cp=!cp!+"%%j\%%i"
- )
- if defined cp copy /b !cp:~1! "汇总-%%a-%%i.csv"
- )
- )
- pause
复制代码
|