Stripping Carriage Returns
Jean-Pierre A. Radley
appl at jpr.com
Thu Apr 1 12:14:26 PST 2004
DataDoIt propounded (on Thu, Apr 01, 2004 at 09:43:00AM -0500):
| I've seen it posted in the past about a small sed or awk script that will
| strip out extra carriage returns from a file.
My sed solution:
: cr+-
# adds CRs if not present, strips them if present.
# if you just cat this file, you miss its essence.
# if you cat -v this file, you see the _real_ ^Ms in it.
# if you've read this in email, switch the ^ and M back
# to just a chr(13).
sed '
s-^M--g
t
s+$+^M+
t
'
--
JP
More information about the Filepro-list
mailing list