[gnu.emacs] regexp help

gregs@well.UUCP (Greg Strockbine) (02/02/90)

Given a line like this:
	font.c, down.c, arc.c
how do I replace the ", " with a newline so each file name
is on a different line?
It works if I define a keyboard macro, but I can't
figure out how to do it with either string-replace or
regexp-replace.
	greg Strockbine

bill@hpcvlx.cv.hp.com (Bill Frolik) (02/03/90)

> Given a line like this:
> 	font.c, down.c, arc.c
> how do I replace the ", " with a newline so each file name
> is on a different line?
> It works if I define a keyboard macro, but I can't
> figure out how to do it with either string-replace or
> regexp-replace.
> 	greg Strockbine


When you specify a replacement string, quote the newline character
with ^Q.  In your example you can use replace-string to search for
", " and replace it with "^Q^J".

________________________________________

Bill Frolik	Hewlett-Packard Co.
hp-pcd!bill	Corvallis, Oregon	

mleisher@nmsu.edu (Mark Leisher) (02/03/90)

\M-x replace-string ,<SPACE> RET \C-q\C-j RET
This should do the trick.

mleisher@nmsu.edu
Mark Leisher
Computing Research Lab
New Mexico State University