Shell - sum of column on user

Basically, I've two columns. First one stands for the users and the second one for the time they've spent on the server. So I'd like to sum for each client, how many minutes did he spend on the server.

user1 21:03
user2 19:55
user3 20:09
user1 18:57
user1 19:09
user3 21:05
user4 19:57

Let's say that I've this. I know how to split but there's one problem. Whenever I do

awk -F: '{print $1}

it prints users and the first parameter of the time (the number before :), and when I do

awk -F: '{print $2}

it prints only the numbers after :. After all of the sum, I'd like to get something like

user1 59:09
user2 19:55
user3 41:14
user4 19:57

Welcome to the forum.

Time and date arithmetics is one of the worst (most difficult) things in IT. Some awk versions (e.g. gawk ) offer date & time functionality; mine doesn't, so I can offer a crude approximation.
Try someting along this line:

awk -F"[ :]" '{SUM[$1] += $2*60 + $3} END {for (s in SUM) print s, int(SUM/60) ":" SUM%60}' file
user1 59:9
user2 19:55
user3 41:14
user4 19:57

Formatting refinement left as an exercise to the reader...

To elaborate a little on what my learned friend RudiC has, the -F you had written was to replace the field separator of 'any white space' with a colon, so the space was being treated as any other character. Sometimes, you might want this to happen.

What the suggestion does is allow you to split fields on either a space or a colon giving you three fields. I just thought I should comment on where you were stuck/confused in your original post.

Now you have something to work with - and there is a completed suggestion to do the maths.

Kind regards,
Robin