convert a newline separated list to a comma separated list
cat dog pig rhino bull cow