I need some help on this:
I've got a [pscustomobject] that contains the below results, get from a xml file
Files Session
----- -------
{IMG_0518.JPG, IMG_0520.JPG, VG_Overview.mp4, } VG_Overview
I need to get the duplicated values on Files, e get it's respective session value:
My code to get the duplicated values: $trse is my [pscustomobject]
$trse | ForEach-Object {$_.Files.Where({ $_ -ne ""})} | Group | Where-Object{$_.Count -gt 1} | Select @{Name="Files";Expression={$_.Name}},@{Name="Session";Expression={$_.Session}},@{Name="Occurrences";Expression={$_.Count}}
and the results are this:
Files Session Occurrences
----- ------- -----------
GC7_Gender.WAV 2
NG6_Gender.WAV 2
NG9_Gender_I.WAV 2
NG9_Gender_II.WAV 2
VG4_Gender.WAV 2
And i need to get this:
Files Session Occurrences
----- ------- -----------
GC7_Gender.WAV VG_Over 2
NG6_Gender.WAV Gh_tre 2
NG9_Gender_I.WAV FG_iop 2
NG9_Gender_II.WAV VB_jkl 2
VG4_Gender.WAV ER_uilv 2
Thanks a lot for any help on this, i think the problem is when i get de duplicated files, i lost the session values.