You don't need a special c program to do this. You can just use the unix
fold(1) program. But, of course the other proposed solutions will work
as well.
$ fold -48 your-file >folded-file
You can then use awk to put in separators. Something like:
$ awk '{printf "%s~%s\\n",substr($0,1,5),substr($0,6,4)}' < folded-file > file
You can pipe the output from fold into awk and do it in one operation,
eliminating the need for storing the folded file.
--
'yvind Gjerstad Systems dept Tollpost-Globe AS N-6301 'ndalsnes/Norway
E-mail: ogj@it.tollpost.no Phone: +47 7122 6663 Fax: +47 7122 6694