🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1162

changing a ! to a \nC where \n is a newline

#1162
From: Sean Sheridan Coleman X5672
Date: Mon, 17 Sep 1990 22:20
19 lines
833 bytes
I am trying to use the global substitution power in vi to 
replace every occurrence of ! with a newline and a C (\nC)

I have tried the following things:

g/;/s//\\nC/g   places the string \\nC where the ; is not a
newline.

g/;/s//\nC/g -- places a nC where the ; is.

Do you know how to make get vi to put a newline not a \n 
when doing the substitution?

How about the reverse, replace a newline with a character?


Sean Coleman
NIST
coleman@bldrdoc.gov
Technical Details
Message-ID: <5015@alpha.cam.nist.gov>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cme!cam!coleman

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cme!cam!coleman
From: coleman@cam.nist.gov (Sean Sheridan Coleman X5672)
Newsgroups: comp.unix.shell
Subject: changing a ! to a \nC where \n is a newline
Keywords: vi
Message-ID: <5015@alpha.cam.nist.gov>
Date: 17 Sep 90 22:20:02 GMT
Organization: National Institute of Standards & Technology, Gaithersburg, MD
Lines: 19