in reply to Clean line ends
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}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Clean line ends
by davorg (Chancellor) on Jan 19, 2007 at 10:39 UTC | |
by smithers (Friar) on Jan 19, 2007 at 19:04 UTC | |
by davorg (Chancellor) on Jan 19, 2007 at 20:35 UTC | |
by smithers (Friar) on Jan 20, 2007 at 15:58 UTC |