Adding commas to end of lines in output file