Unless I've mis-interpreted it, having done the hard work as posited by
toolic, the problem is now down to the printed representation - maybe this, or something not unlike it, is more along the lines of what you're seeking...
use warnings;
use strict;
use Data::Dumper;
my %Diag;
while (<DATA>) {
my ($name, $val) = split;
push @{ $Diag{$name} }, $val;
}
print "$_ => " . join(' ', @{$Diag{$_}}) . "\n" for keys %Diag;
__DATA__
Name1 1234
Name2 9999
Name1 5514
Name3 5415
Name2 6419
A user level that continues to overstate my experience :-))