Wednesday, May 7, 2014

Re: Search in VI (VIM) for a string, then delete to end of line.

Hi Nerdio!

On Mi, 07 Mai 2014, Nerdio wrote:

> I have a requirement which I am sure I can do in vi (plenty of other solutions I am sure), and this is it.
>
> I have a file that looks like this
>
> 1234 Some Text HERE rest of line
> 1235 Some Other Text HERE rest of line
>
> What I want to do is delete text from, and including the word HERE to the end of the line, leaving me with this;
>
> 1234 Some Text
> 1235 Some Other Text
>
> I have done search and replace things in vi, but am not sure how to do a search then run a command.

Search and replace sounds like the correct solution here. What is wrong
with it?

Best,
Christian
--
Viele Menschen fliehen in die Diktatur, weil es guter Nerven bedarf,
die Demokratie zu ertragen.
-- Hans Habe

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: