I've read all over and can't manage to script myself a batch file that will copy files to specific folders depending on their names.
I have a company with employees saving their timesheets as .pdf files. I have a folder named "Time sheets", and within that I have folders named "2016", "2017", "2018", etc. Within each of those, I have folders named "January", "February", "March", etc. for every month.
The timesheets are saved under names such as "Time sheet_171203_EmployeeName.pdf". I'd like to have a batch file that will
1) identify the file as a timesheet and not another file (many reports are saved in the source folder "PDF Reports");
2) copy the time sheet from the source folder to whatever the month is indicated as within the time sheet name. For the example above, the time sheet should be copied to "Time sheets\2017\December\Time sheet_171203_EmployeeName.pdf". Now in January, it should automatically switch over to "Time sheets\2018\January\...", etc.
I am rather new with batch files. I have only begun coding JavaScript and have been coding Lua for some years now. The format batch files take on is rather intriguing and very new to me.
I'm very confused as to where to start. I know these steps must be met, but I'm unsure how to code them:
I must identify the "PDF Reports" directory;
I must iterate through all .pdf files and identify those with the filename of "Timesheet*" using the for command;
I must then set variables and somehow extract the year %%mmdd and month yy%%dd to then transfer to the proper output folder (ex 2017\December);
I must make it so that this batch file executes every time a file is added to the directory
Could anyone help me start this project? I realize this is not the simplest code to accomplish as a first-timer...! Any help is appreciated while I read through tutorials. I sure hope I'm at the right place!