Aggregate data based on some field

Input :

123456 Failed 123.40
123456 Failed 1234
123456 Success 1200
123 Failed 120

Output :

123456 failed (123.40+1234)
123456 success 1200
123 Failed 120