I'm trying to do this in PowerShell. I've got a CSV file that looks like the following (note the ... means any number of values):
Name,...,Value
Adam,...,1
Bob,...,2
Chris,...,3
Adam,...,4
Bob,...,5
Chris,...,6
I want to add all the values for each person together so it outputs the below:
Name,...,Value
Adam,...,5
Bob,...,7
Chris,...,9
I'm using Group-Object to get a hash table.
$table = Import-CSV "c:\input-file" | Group-Object -Property Name -AsHashTable -AsString
But I'm not sure how to proceed to add the values up and then output to a CSV. Can anyone help? Or does anyone have another solution?