Tr

From DWIKI

HOWTO

Concatenate all lines in a file

comma separated:

tr '\n' ',' < file.txt