I have loop, where I'll copy all *.txt files to big.txt in the same directory. In each loop step I want additional copys of different files in different folders with the same first three characters in file name from files in first directory.
Example:
\A\001.txt
\A\003.txt
\A\005.txt
\A\big.txt
\B\001_sth.xml
\B\002_sth.xml - don't copy! no 002 in folder A
\B\003_sth.xml
\B\004_sth.xml - don't copy! no 004 in folder A
\B\005_sth.xml
\B\big.xml
In step 1: copy \A\001.txt to \A\big.txt AND \B\001_sth.xml to \B\big.xml etc
I wrote the batch file to only copy files in directory A, but I have no idea how to find files directory B.
@echo off
if "%1"=="" goto error
for %%x in (%1\A\*.txt) do (
copy %%x %1\A\big.txt
echo %%x
echo ---
)
goto end
:error
echo give me a directory
:end