How to insert a new line character after a fixed number of characters in a file

前端 未结 7 447
别那么骄傲
别那么骄傲 2020-12-02 12:16

I am looking for a bash or sed script (preferably a one-liner) with which I can insert a new line character after a fixed number of characters in huge text file.

相关标签:
7条回答
  • 2020-12-02 13:17

    This might work for you:

    echo aaaaaaaaaaaaaaaaaaaax | sed 's/./&\n/20'
    aaaaaaaaaaaaaaaaaaaa
    x
    
    0 讨论(0)
提交回复
热议问题