substituting <cr> in vi

substituting <cr> in vi

Post by Karlon We » Wed, 01 Nov 1995 04:00:00




Quote:> hello
> i use the substitution command:
> :g/xxx/s//yyy/
> in vi to replace char strings.
> i have also used:
> :1,135:s/xxx/yyy/
> in vi to get a similar result, limited to a certain range of the text.
> my question is:
> how would i replace a char string with a <cr> or newline?
> i.e.   :g/xxx/s//<cr>/
> i have looked at manuals large and small and have not found the answer.
> thanks in advance
> baily

 :1,135s/xxx/ctrl-Vctrl-M/g     is how it is typed in

 :1,135s/xxx/^M/g               is how it looks

 
 
 

substituting <cr> in vi

Post by dr. » Wed, 01 Nov 1995 04:00:00


hello

i use the substitution command:

:g/xxx/s//yyy/

in vi to replace char strings.

i have also used:

:1,135:s/xxx/yyy/

in vi to get a similar result, limited to a certain range of the text.

my question is:

how would i replace a char string with a <cr> or newline?

i.e.   :g/xxx/s//<cr>/

i have looked at manuals large and small and have not found the answer.

thanks in advance

baily

 
 
 

substituting <cr> in vi

Post by Alan H. Ka » Wed, 01 Nov 1995 04:00:00




> how would i replace a char string with a <cr> or newline?

> i.e.   :g/xxx/s//<cr>/

Precede cr with ctl-v. This allows a control char to be entered.

--
Alan H. Katz          | MJ Research, Inc.

617-923-8001 ext.149  | Watertown, MA 02172
                      |

 
 
 

1. CR <-> CR/LF <-> LF ?

        does anyone have a script that strips or adds CR or LFs to the
end of each line? I.e. translate from Mac text to Dos text/unix text and
vice versa. Thanks.

--Jauder
--
                               Jauder Ho        
                       Chaos Theory Group, Physics    


2. Virtual Servers

3. grep <CR><CR> delimited lines in text file?

4. Repost: Making second disk of a RAID 1 set bootable

5. <><><> MOUNTING EXTENDED PARTITION <><><>

6. Respawning too quickly

7. Wanted: <><><> Unix Specialist <><><>

8. Resolving IPs

9. LILO help <><><><><><>

10. telnet <NL> -> <CR> conversion

11. Konsole and <ins> <del> keys

12. <CR><LF> and <LF><CR> for newline problem ? Help

13. <CR><LF> and <LF><CR> for newline problem. Help.