sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
* How do I reference carriage returns?
@ 1994-01-17 10:07 Beirne Konarski
  1994-01-17 10:26 ` John Mackin
  0 siblings, 1 reply; 4+ messages in thread
From: Beirne Konarski @ 1994-01-17 10:07 UTC (permalink / raw)
  To: Sam mailing list

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
beirnek@summitis.com            | ready man, and writing an exact man.
"Untouched by Scandal"          |       -- Francis Bacon
-------------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I reference carriage returns?
  1994-01-17 10:07 How do I reference carriage returns? Beirne Konarski
@ 1994-01-17 10:26 ` John Mackin
  1994-01-17 16:54   ` Castor Fu
  0 siblings, 1 reply; 4+ messages in thread
From: John Mackin @ 1994-01-17 10:26 UTC (permalink / raw)
  To: Sam Fans

[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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I reference carriage returns?
  1994-01-17 10:26 ` John Mackin
@ 1994-01-17 16:54   ` Castor Fu
  0 siblings, 0 replies; 4+ messages in thread
From: Castor Fu @ 1994-01-17 16:54 UTC (permalink / raw)
  To: John; +Cc: sam-fans

> 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.)
> 

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

	-castor


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I reference carriage returns?
@ 1994-01-18  2:47 Byron Rakitzis
  0 siblings, 0 replies; 4+ messages in thread
From: Byron Rakitzis @ 1994-01-18  2:47 UTC (permalink / raw)
  To: john, sam-fans

If you have the ^M on the screen, you can snarf it with the mouse
from the text window, then go to the command window:

	,x/

[PASTE]

	,x/^M/d

and run the command. No reason to guess about where the ^M's might
be, you just need to locate one visually.

Granted, though, 99% of the time they are on the end of the line.
It's just that this is a neat hack for dealing with any character
you can see but you don't know how to generate.

Byron.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1994-01-18  3:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-01-17 10:07 How do I reference carriage returns? Beirne Konarski
1994-01-17 10:26 ` John Mackin
1994-01-17 16:54   ` Castor Fu
1994-01-18  2:47 Byron Rakitzis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).