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

How about something like this? Change 20 is the number of characters before the newline, and temp.text is the file to replace in..

sed -e "s/.\{20\}/&\n/g" < temp.txt

Leave a Comment