Add space between every letter

前端 未结 6 1365
感情败类
感情败类 2020-12-09 03:54

How can I add spaces between every character or symbol within a UTF-8 document? E.g. 123hello! becomes 1 2 3 h e l l o !.

  • I have
6条回答
  •  孤城傲影
    2020-12-09 04:41

    Since you have bash, I am will assume that you have access to sed. The following command line will do what you wish.

    $ sed -e 's:\(.\):\1 :g' < input.txt > output.txt
    

提交回复
热议问题