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.
#all start of line => ' (insert)
#all end of line => ', (append)
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.