в perl
perl -ne 'next if /^\s*$/ ; /^(\w+).*?(\d+(\.\d+){3})/; print "$1\t$2\n"' test_file
для отсортированных результатов вы, вероятно, могли бы передать вывод в команду сортировки
perl -ne 'next if /^\s*$/ ; /^(\w+).*?(\d+(\.\d+){3})/; print "$1\t$2\n"' test_file | sort
Обновлен скрипт, например, версия
my $test_file = shift or die "no input file provided\n";
# open a filehandle to your test file
open my $fh, '<', $test_file or die "could not open $test_file: $!\n";
while (<$fh>) {
# ignore the blank lines
next if /^\s*$/;
# regex matching
/ # regex starts
^ # beginning of the string
(\w+) # store the first word in $1
\s+ # followed by a space
.*? # match anything but don't be greedy until...
(\d+(\.\d+){3}) # expands to (\d+\.\d+\.\d+\.\d+) and stored in $2
/x; # regex ends
# print first and second match
print "$1\t$2\n"
}