Hi All,
I have an imported CSV:
Project,StartDate,StartTime,EndDate,EndTime,Duration
Project 1,19122018,16:39:26,19122018,16:39:28,00:01.8
Project 2,19122018,16:39:28,19122018,16:39:29,00:00.3
Project 3,19122018,16:39:29,19122018,16:39:29,00:00.4
Project 4,19122018,16:39:29,19122018,16:39:29,00:00.3
Project 5,19122018,16:39:29,19122018,16:39:30,00:00.3
Project 6,19122018,16:39:30,19122018,16:39:30,00:00.3
Project 1,19122018,16:39:30,19122018,16:39:31,00:00.5
Each project can occur multiple times on the same day or over several days. I am attempting to sum the duration of each project on each day.
$output = (Import-CSV -Path csvPath -Delimiter ",") | Group-Object -property StartDate,Project $output foreach ($name in $output) { write-host $name.name "," $name.Group.Duration }
I have gotten as far as the above, which groups by date, then by project as desired, unfortunately I am struggling to Sum the duration as they appear to be stored as text rather then timespan?
Is anyone able to suggest a way around this?
Thanks in advance