perl -pi.bak -e 's/(?<!\r)\n/\r\n/' cobolfile
See perlre.
--shmem
update: as davorg pointed out, it is better to use control chars for newline conversions. The look-behind assertion above replaces bogus newlines elsewhere, not only at blank lines.
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Clean line ends
by shmem
in thread Clean line ends
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |