How to replace space with comma using sed?

前端 未结 8 834
-上瘾入骨i
-上瘾入骨i 2020-12-30 22:52

I would like to replace the empty space between each and every field with comma delimiter.Could someone let me know how can I do this.I tried the below command but it doesn\

8条回答
  •  别那么骄傲
    2020-12-30 23:05

    I know it's not exactly what you're asking, but, for replacing a comma with a newline, this works great:

    tr , '\n' < file
    

提交回复
热议问题