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
More Related Contents:
- sed substitution with Bash variables
- How can I do a recursive find/replace of a string with awk or sed?
- Bash tool to get nth line from a file
- How to pass a variable containing slashes to sed
- Recursively rename files using find and sed
- Remove first N lines of a file in place in unix command line
- How to address error “bash: !d’: event not found” in Bash command substitution [duplicate]
- How to add to the end of lines containing a pattern with sed or awk?
- Remove Unicode characters from textfiles – sed , other Bash/shell methods
- How to replace an entire line in a text file by line number
- Using sed to mass rename files
- Delete all lines beginning with a # from a file
- Why does sed not replace all occurrences?
- Insert newline (\n) using sed
- How to use a bash script variable with sed [duplicate]
- Error with sed unterminated s command in bash
- Convert line endings [duplicate]
- Using sed to insert file content
- Getting “sed error – illegal byte sequence” (in bash) [duplicate]
- Extract version number from a string
- how to delete the duplicate lines in file except the first matched line
- find difference between two text files with one item per line [duplicate]
- Can I use sed to manipulate a variable in bash?
- Grep output with multiple Colors?
- escaping newlines in sed replacement string
- How to append a string at end of a specific line in a file in bash [duplicate]
- How to replace paired square brackets with other syntax with sed?
- using bash (sed/awk) to extract rows AND columns in CSV files?
- Utility to extract dates from filenames in Bash?
- How to grep for case insensitive string in a file?