How do you put a comma at the end of each line in Linux?

Thanh Hoan

New member
How do you put a comma at the end of each line in Linux?
Answer
Keep it simple, just use awk: $ awk ‘{printf “%s%s”,sep,$0; sep=”,n”} END{print “”}’ file {…}, {…}, {…}, {…}
 

Tìm kiếm

Back
Top