Actually, in the general case, the previous answers are better.
I was just offering an option for changing the content of the file, rather than the output.
Depends on exactly what you want.
vim cmds
Code:
#all start of line => ' (insert)
:%s/^/'/
#all end of line => ', (append)
:%s/$/',/
You'd just manually delete last ','
Actually, for the latter, you can specify the line range (specify start & end line nums) to edit, thus avoiding last comma.