Posted in 1998
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
We use strictly necessary cookies to make this site work. With your consent we’d also use optional cookies for analytics and marketing. You can accept all, reject all, or choose. Read our Cookie Policy.