I have a ascii file with lines like this:
240|^M\ ^M\^M\ Old Port Marketing order recd $62,664.- to ship 6/22/99^M\
when this record gets loaded into my database, the \ is stored literally and so the user sees carriage return \ (hex 0D 5C) when what i need is carriage return line feed (hex 0D 0A).
any ideas on how i can accomplish this with sed?
P. S. awhile back, Perderabo wrote this sed script for me
#! /usr/bin/sed -nf
#
#
s/^M\\$/^M\\/
H
t
x
s/\n//g
p
s/.*//
h
which altered a files like this:
240|^M\
^M\
^M\
Old Port Marketing order recd $62,664.- to ship 6/22/99^M\
to look like this:
240|^M\ ^M\^M\ Old Port Marketing order recd $62,664.- to ship 6/22/99^M\