Subject: How do I reference carriage returns?

From: [email-masked] (Beirne Konarski)
Date: Mon, 17 Jan 1994 05:07:30 -0500

I am getting better at sam now and am using it daily, but I have come
up with a simple problem I can't solve.  I have a file with CR-NL at
the the of each line and I want to remove the carriage returns.  I of
course know how to do it with a variety of other tools, including vi.
I like working on files with sam, though.  The problem is that I cannot
select the carriage returns.  The usual tricks like \r and \015 didn't
give them to me.  Is there a way to select them?  Or am I supposed to
pipe the file through tr, like in rc?

Beirne
-- 
-------------------------------------------------------------------------------
Beirne Konarski                 | Reading maketh a full man, conference a
[email-masked]            | ready man, and writing an exact man.
"Untouched by Scandal"          |       -- Francis Bacon
-------------------------------------------------------------------------------

---

From: John (Farewell Horizontal!) Mackin <[email-masked]>
Date: Mon, 17 Jan 1994 05:26:51 -0500

[Just making a guest appearance on the Sam Fans list.]

This is a good question.  The fact is that sam handles control characters
rather well, always excepting null characters, but control-M presents a
particular problem because (at least on UNIX under most conditions)
you can't _type_ it.  If you could type it, you could just deal with
it directly -- try this with characters like control-A, control-G, et al.
They work great, inserting themselves when typed, and functioning correctly
inside commands.  (You may have problems _displaying_ these characters,
since they come down to the font you are using, presumably under X --
try to use a font which displays control characters somehow.)

To return to control-M, though, you can't deal with it since there is no
way to type it.  This isn't too bad, usually, since in the typical case
the file you want to fix up has a control-M as the last character of
_every_ line, and so the trivial

	,x/.$/d

deals with it very effectively.  If you aren't convinced that every line
ends with control-M, then yes, old faithful tr is the best solution.

OK,
John.

---

From: Castor Fu <[email-masked]>
Date: Mon, 17 Jan 1994 11:54:08 -0500

> try to use a font which displays control characters somehow.)

Of course, once you display them, you can cut and paste them pretty 
easily.  This is what I usually do.

	-castor