|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
replace string with deleted lineI have a file that contains a bunch of lines with only the word "foo" on it. I want go through the entire file and remove the lines with the words "foo". Not just remove the word, but the entire line. How is this done in vim? I tried :%s/foo//g but it left the line thank you! --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: replace string with deleted lineOn Tue, 2009-11-10 at 08:24 -0800, Jason wrote: > I have a file that contains a bunch of lines with only the word "foo" > on it. > > I want go through the entire file and remove the lines with the words > "foo". Not just remove the word, but the entire line. > > How is this done in vim? > > I tried :%s/foo//g > > but it left the line > > thank you! > > > $ grep -v foo thefile > newfile --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: replace string with deleted lineOn Tue, Nov 10, 2009 at 18:09, Reid Thompson <reid.thompson@...> wrote: > > On Tue, 2009-11-10 at 08:24 -0800, Jason wrote: >> I have a file that contains a bunch of lines with only the word "foo" >> on it. >> >> I want go through the entire file and remove the lines with the words >> "foo". Not just remove the word, but the entire line. >> >> How is this done in vim? >> >> I tried :%s/foo//g >> >> but it left the line >> >> thank you! >> >> > > > $ grep -v foo thefile > newfile > :g/foo/d Regards -- Étienne --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: replace string with deleted line> I want go through the entire file and remove the lines with the words > "foo". Not just remove the word, but the entire line. > > How is this done in vim? > > I tried :%s/foo//g > > but it left the line You'd want :g/foo/d -tim --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: replace string with deleted lineHi Jason! On Di, 10 Nov 2009, Jason wrote: > I want go through the entire file and remove the lines with the words > "foo". Not just remove the word, but the entire line. :g/foo/d regards, Christian -- • It's one of those rare "perfect" kernels. So if it doesn't happen to compile with your config (or it does compile, but then does unspeakable acts of perversion with your pet dachshund), you can rest easy knowing that it's all your own damn fault, and you should just fix your evil ways. Torvalds, Linus (2006-11-29). --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: replace string with deleted linethank you everyone! That is pretty simple! I also appreciate the grep example. On Nov 10, 10:14 am, Christian Brabandt <cbli...@...> wrote: > Hi Jason! > > On Di, 10 Nov 2009, Jason wrote: > > > I want go through the entire file and remove the lines with the words > > "foo". Not just remove the word, but the entire line. > > :g/foo/d > > regards, > Christian > -- > • It's one of those rare "perfect" kernels. So if it doesn't happen to > compile with your config (or it does compile, but then does unspeakable > acts of perversion with your pet dachshund), you can rest easy knowing that > it's all your own damn fault, and you should just fix your evil ways. > Torvalds, Linus (2006-11-29). You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: replace string with deleted lineinterestingly, I'm finding gvim might be faster and easier for manipulating data than a spreadsheet. On Nov 10, 10:14 am, Christian Brabandt <cbli...@...> wrote: > Hi Jason! > > On Di, 10 Nov 2009, Jason wrote: > > > I want go through the entire file and remove the lines with the words > > "foo". Not just remove the word, but the entire line. > > :g/foo/d > > regards, > Christian > -- > • It's one of those rare "perfect" kernels. So if it doesn't happen to > compile with your config (or it does compile, but then does unspeakable > acts of perversion with your pet dachshund), you can rest easy knowing that > it's all your own damn fault, and you should just fix your evil ways. > Torvalds, Linus (2006-11-29). You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |