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

**URL:** <https://forums.powershell.org/t/sorting-8000-files-by-name-in-folders-newbie-to-powershell/13702>\
**Category:** PowerShell Help\
**Created:** [January 24, 2020, 8:40am UTC](https://forums.powershell.org/t/sorting-8000-files-by-name-in-folders-newbie-to-powershell/13702 "2020-01-24T08:40:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcross87](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@mcross87](https://forums.powershell.org/u/mcross87)\
**Post date:** [January 24, 2020, 8:40am UTC](https://forums.powershell.org/t/sorting-8000-files-by-name-in-folders-newbie-to-powershell/13702/1 "2020-01-24T08:40:42Z")

</div>

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).

&nbsp;

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.

&nbsp;

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.

&nbsp;

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.

&nbsp;

Any Help would be appreciated.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/sorting-8000-files-by-name-in-folders-newbie-to-powershell/13702/2 "2024-05-16T20:30:45Z")

</div>


