How to replace space with comma using sed?

前端 未结 8 796
-上瘾入骨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:14

    If you are talking about sed, this works:

    sed -e "s/ /,/g" < a.txt
    

    In vim, use same regex to replace:

    s/ /,/g
    

提交回复
热议问题