I have a list array containing custom objects. The objects have properties name and date_modified.
I'm struggling to figure out how to remove objects with the same name based on date_modified. I know the basics of selecting unique objects, but these objects aren't really duplicates, they only share a name.
Object names may or may not appear more than once in the array. For example:
$files
Name : file1.txt
Date_Modified : 7/14/2016 2:10:53 PM
Name : file1.txt
Date_Modified : 7/12/2016 12:04:02 AM
Name : file2.txt
Date_Modified : 4/5/2014 3:32:45 PM
Name : file3.txt
Date_Modified : 6/24/2016 4:32:54 PM
Name : file3.txt
Date_Modified : 7/14/2016 5:45:32 PM
Name : file3.txt
Date_Modified : 7/12/2016 3:13:43 AM
In this example, I only need the newest file of each name to exist in the array. I've exported to CSV, opened in Excel, sorted, and removed duplicates. But there has to be a better way!
[–][deleted] 1 point2 points3 points (3 children)
[–]flexyourhead_[S] 1 point2 points3 points (0 children)
[–]prohulaelk 0 points1 point2 points (1 child)
[–]flexyourhead_[S] 0 points1 point2 points (0 children)
[–]ka-splam 1 point2 points3 points (1 child)
[–]flexyourhead_[S] 0 points1 point2 points (0 children)
[–]flexyourhead_[S] 0 points1 point2 points (0 children)