perl -pe '$_=join(",",map{s/\D//g;$_} split(":",(split(" ",$_))[-1]))."\n"' < input > output