Page 1 of 1

Copy file based on match name file

Posted: 11 Nov 2010 01:29
by darioit
Hello Everybody,

I have a lot file named:
aa1.bb5.ccc.001
aa2.bb6.ccc.010
aa3.bb7.ddd.123
aa4.bb8.ddd.456

Executing a batch passing a parameter equal 3 qualifier (ccc or ddd) I-d like to copy all the files that are equal in 3 qualifier, like this example

run_batch.bat ccc
result ccc (name file) given from file aa1.bb5.ccc.001+aa2.bb6.ccc.010

Regards
Dario

Re: Copy file based on match name file

Posted: 11 Nov 2010 09:27
by !k

Code: Select all

for /f %%a in ('dir *.%1.* /b/a-d/on') do type "%%a" >> %1

Re: Copy file based on match name file

Posted: 11 Nov 2010 10:49
by darioit
Works Great, may Thanks

Dario