I want add a comma at the end of every line of this kind of file except the last line:
I have this now:
{...} {...} {...} {...}
I w
You can use something like this:
sed 's/$/,/' file.txt > file_with_added_commas.txt
This will substitute the end of the line with a ',' and write it to file_with_added_commas.txt
For more information refer to: add text at the end of each line