This variable is used to set output record separator, by default a newline.
awk 'BEGIN{ORS=","} {print $0}' file