in reply to How do I wrap long lines at a fixed width, ignoring word boundaries?

You could do this with a substitution:

s/(.{128})/$1\n/g;

This does not add a newline to the final segment if it's shorter than 128 characters.

  • Comment on Re: How do I wrap long lines at a fixed width, ignoring word boundaries?
  • Download Code