How do I use all the .txt files in a particular folder as input into my batchscript, without having to hardcode their names individually?
In short: I want the batch script to process all the .txt files in the directory it resides in.
Current code:
for /f "tokens=4 delims=|" %%a in (filename1.txt) do (...)
…which reads only one.
I’ve tried the following methods that do not work:
for /f "tokens=4 delims=|" %%a in ('dir /b C:\BatchScripting') do (..)
And:
for /f "tokens=4 delims=|" %%a in (*.txt) do (...)
And this too:
for /f "tokens=4 delims=|" %%a in (%%~dpnx) do (...)
But to no avail. Help!
I think you are after this