perl -pe "s/^(.*?)(\n)?$/'$1', /; (chop, chop) if eof" t.txt