I have been struggling with the following on powershell:
I have files with the first 3 characters referencing an ID and the rest of the filename contains a timestamp.
ABC.2019-10-23 SIZE: 5KB
ABC.2019-10-22 SIZE 7KB
DEF.2019-10-23 SIZE 4KB
DEF.2019-10-22 SIZE 11KB
Now the files are of different file sizes. What I would like to do is rename the largest files that include a distinct ID.
All the files are in the same folder and can be looped through without recursion.
After completing the task it should have renamed the files:
ABC.2019-10-22.old
DEF.2019-10-22.old
Because the first one is the largest file that contains the 3 character substring ABC
And the second file is the largest file that contains the substring DEF
This should be done to all the biggest files containing a distinct 3 character ID
Any help would be much appreciated!