How do I loop through the files in the folder and parse the portion of the file name and store it in a variable + echo?
Folder contains following files and need to pull out the year:
Actual2015.txt
Actual2016.txt
What I tried:
for %%f in (*.txt) do (
set year=%%f:~7,4%
echo %year%
)
result should be:
2014
2015