I have this problem: I have a text file, where every line has different number of characters, like this:
aaaa bbbbbbbbb cc
Now I want to generate a new text file, where a line has at maximum N characters, but no content is missing. So, something like this (e.g. each line should have at maximum 4 characters):
aaaa bbbb bbbb b cc
Is this possible with
grep or other tools in combination with a one-liner?