awk '{ seen[$1] = $2","seen[$1] ; } END { for (key in seen) { print key" "seen[key] ; } } ' /your/file.txt > /your/newfile.txt