I have a Files they have a Date in the name.
ex:
2017-07-10 12-25-46[Work].wav
...
and i want to sort/move the Files in Folders like this
2017-07-10 12-25-46[Work].wav -> /2017.28/2017-07-10 12-25-46[Work].wav
...
i searched in the internet for this Problem but there is not much to find.
hopping you guys can help me
i just found this function on google:
function Get-WeekNumber([datetime]$DateTime = (Get-Date)) {
$cultureInfo = [System.Globalization.CultureInfo]::CurrentCulture
$cultureInfo.Calendar.GetWeekOfYear($DateTime,$cultureInfo.DateTimeFormat.CalendarWeekRule,$cultureInfo.DateTimeFormat.FirstDayOfWeek)
}
I am a programming noob. can just desribe the code with my words.
- Loading Filenames in to a varible.
- date(a) = split Filename(a) by " "
- extract year and week from date(a)[0]
- move file from current localtion to $targetlocation/$year.$week/$Filename(a)
- a++ and goto 2