I need to format a mailing list, by adding a comma at the end of every line. This question has been already asked, however I don't get the expected result with the suggested answer:
sed '$!s/$/,/' file > out.txt
results in:
[email protected]
,
[email protected]
,
[email protected]
. . .
Is there anyway it can be improved ? I'd need rather need:
[email protected],
[email protected],
[email protected],
. . .
Thanks!
Use the following approach to add comma at the end of each line:
sed 's/$/,/' file > out.txt
s/regexp/replacement/flags
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With