Monday, November 1, 2010

Re: delete only the short sentences

On 10/31/10 23:14, Joan Miquel Torres Rigo wrote:
> 2010/11/1 AMDx64BT<amdx64bt@gmail.com>:
>> And to keep only the sentences in the range 40-60 characters long and
>> delete the rest?
>
> :g/^.\{,39\}$/d
>
> and
>
> :g/\(^.\{,39\}$\)\|\(^.\{61,\}$\)/d

And to reverse the condition, one could use something like

:v/\%40c./d

("if there's a character at position 40, don't delete this row;
otherwise, delete it")

-tim

--
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

No comments:

Post a Comment