Lines are terminated by any sequence of carriage-return or newline characters (‘\r’ or ‘\n’). Windwos systems will place “\r\n”, but other systems will not.

Final comma

A comma is not placed after the final cell value on a row/line, the line ending “\r\n” is just used without it (unless you want to place commas for unused cells there of course).