in reply to Break continuous lines of a text file based on character lengths

Do you mean "insert a newline after every 104 characters", like this:
while (sysread(INPUT,$buf,104)) { print OUT $buf."\n"; }

Or do you intend to break the lines in sensible places, as long as no line is longer than 105 characters? For that you would need to scan through the buffer for the sensible place in which to put the newline.

  • Comment on Re: Break continuous lines of a text file based on character lengths
  • Download Code