Sorting 8000 Files by Name in folders ( Newbie to Powershell )

Hey everyone,

Here is what i have going on. I have to sort about 8000 files by year/ client / then 2 separate folders biased on type.

I have them all in one folder now and there are 3 names that need to be grouped together into one folder then sorted by YEAR then Name. Just for Example, the 3 files would look something this FT-TEST19-203.dbf, FT-TEST19-203.shx, FT-TEST19-203. shp. These files need to go in a directory that would look like this 2019/TEST/FT/(Then my folder for FT-TEST19-203). I also have files named TD-TEST19-203.dbf, TD-TEST19-203.shx, TD-TEST19-203. shp and these files would have to be in the folder 2019\TEST\TD(Then my folder for FT-TEST19-203).

 

To do this manually would take forever and this is a reoccurring thing that I would need to complete weekly. So, automating it with a script would be the best. I also have a CSV file that has the NAME and DATE.

 

Here is the KICKER, when we exported the files it took the date exported instead of the Data Created when the file was made. I also have a CSV file with the Names and Dates created. Is there any way to modify the DATE CREATED on all the files with the same names. Could this be done by a import_CSV and use that as a reference to modify the DATE CREATED.

 

If I could change the DATE CREATED on each file to correspond with the CSV file I would be happy with just sorting them by the dates and put them in folders by YEAR/MONTH.

 

Any Help would be appreciated.