Using awk:
$ awk '{if (NR>1) print a "," OFS; a=$0}END {if (NR) print ""}'
If only comma is needed without space and all records have only one fields, then datamash may be used.
$ datamash -W collapse 1 <file
Using awk:
$ awk '{if (NR>1) print a "," OFS; a=$0}END {if (NR) print ""}'
If only comma is needed without space and all records have only one fields, then datamash may be used.
$ datamash -W collapse 1 <file