convert rows to columns

hi,

i have the file as below:

abc
def
ghi
jkl

i want the output as
abc,def,ghi,jki

please reply,

Thanks

tr "\n" "," < input_file

To remove the last comma

tr "\n" ","  < input_file | sed 's/,$//'

--ahamed

Or...

paste -s -d, input_file
 
$ nawk 'BEGIN{FS="";ORS=","} {print}' test | sed 's/,$//'
abc,def,ghi,jkl
$ xargs < infile | sed 's, ,\,,g'