So I have a batch file that checks for files in a directory against 4 different file extensions and processes them if they have the correct file extension:
set count=0
for %%x in (*.J_E, *.J_T, *.J_I, *.BCC) do (
set /a count=count+1
set choice[!count!]=%%x
)
for /l %%x in (1,1,!count!) do (
echo %%x. !choice[%%x]!
tlv2txt !choice[%%x]! > !choice[%%x]!.txt
)
What I would like to do is add the ability to also use files where the filename contains a certain string like 'marmite'. For example..
By running the batch file I would be looking to 'process' the files marked with an asterisk only:
- stuff.j_e *
- Things.j_t*
- MoreStuff.j_i *
- SomeThings.txt
- SomeMarmiteInA.jar *
- NotThisFile.jim
- OrThisOne.txt
- ThisOneThough.bcc*
- marmiteOnToast.tlv*
Like I said, I can get the file extensions, but I haven't the foggiest idea how to get filenames that contain.. Is this do-able?
*marmite*.*So, using the example above;for %%x in (*.J_E, *.J_T, *.J_I, *.BCC, *marmite*.*)Hope this helps someone! :)