Hi David,
With Apple's version of sed, you simply use the literal characters for carriage return and tab. Of course the shell reacts to them when they are typed so you must escape them to get them into an actual command. You can type a carriage return with the character sequence <Control>-v<Control>-m and the shell represents it with the sequence ^M. You can get a tab with the sequence <Control>-v<Tab>.
Dealing with a newline is more complex because sed is a line based utility so the newline isn't treated as part of the line. If you use sed's 'N' command, that will read the next line and append it to the pattern space with a newline between the two "lines". Thus, the command that will do what you want to the first and second lines would look like the following in the command line:
sed -e 'N;s/^M\n/<Tab>/g' <file>
Of course the <Tab> would just look like a long space and both special characters are typed as I described above. Sed does replace the "\n" with a newline.
As I said, this only works for a pair of lines. To do this with a whole document you would have to write a loop. Unfortunately I don't have time to go into that now as I must go out of town shortly. If you don't know how to do it and no one has suggested anything by tomorrow evening, I'll describe it.
--
Gary
~~~~
The best thing about growing older is that it takes such a
long time.