vi editor
How do i delete a specific string in vi? Suppose i want to delete only the instance "ing" occuring in a file through vi , how could i do this??
|
Quote:
Have a backup of the file and use the following command cat filename | sed 's/ing//g' > filename If this results in empty file use the commands shown below sed 's/ing//g' filename > temp mv temp filename Hope this helps... |
I think following should do your job
:%s/ing//g thnks |
vi/vim: bring up the cmd line ie
<esc>: then :%s/ing//g explanation s/x/y/ = substitute/string_to_find/replacement_string/ % = for all lines g = for all occurrences make sure you take a backup first. Also, you can immediately undo using <esc>u |
All times are GMT -5. The time now is 07:17 AM. |