I have a folder (Students located in server A) containing 800 files, each has a unique identifier in the first 6 characters of the filename (e.g.Y9L-01_xxx.xlsx; Y9L-02_xxx.xlsx; Y9L-03_xxx.xlsx etc).
I have folders with sub folders where I would like to transfer the files. These folders are located in server B.
Each folder in number 2 above contains the same 6 character unique identifier of the filename at the beginning of the folder name (Y9L-01; Y9L-02; Y9L-03). There is a sub folder called 2014_Hockey under the folders Y9L-01; Y9L-02; Y9L-03;
I would like to transfer the files from the "Students" folder described in 1 above to each of the 2014_Hockey folder that is located under Y9L-01; T9L-02; Y9L-03 etc described in 2 and 3 above.
Effectively, I would like the script to match the first 6 characters of the file name with the first 6 characters of the folder names described in #3 and then move the file to the 2014_Hockey folder under that folder.
Example: The .xslx file in \Students\Y9L-01_HockeyChampionship.xslx located in server A to move to Y9L-01\2014_Hockey located in server B
How do I do this?