Skip to main content

Posts

Showing posts from October, 2020

Use vi editor to insert newline char in replace

In vi to insert a newline character in a search and replace, do the following  :%s/look_for/replace_with^M/g  The command above will replace all instances of “look_for” with  “replace_with\n” (with \n meaning newline)  Note: To get the “^M”, enter the key combination “ctl-V” then after that (release all keys) press the “enter” key.