A Unix application creates its reports so that each line ends in ^M, and the next row after a page break ^L appears on the same line when viewed with emacs, eg:
page 1 row 1 ^M
...
last report line on page 1 ^M^L----first report line on page 2 ^M
page 2 line 2 ^M
I need to replace in a ksh script, the ^L with a newline character so that I force the following report line in a row of its own. I don't need the page break.
I tried: sed 's/^L/\n/g' $in_file > $temp_file
but that results in:
last report line on page 1 ^Mn----first report line on page 2 ^M
Any ideas? using sed? any other representation for the newline character, eg ^?
page 1 row 1 ^M
...
last report line on page 1 ^M^L----first report line on page 2 ^M
page 2 line 2 ^M
I need to replace in a ksh script, the ^L with a newline character so that I force the following report line in a row of its own. I don't need the page break.
I tried: sed 's/^L/\n/g' $in_file > $temp_file
but that results in:
last report line on page 1 ^Mn----first report line on page 2 ^M
Any ideas? using sed? any other representation for the newline character, eg ^?