* delete non-matching lines
@ 2009-08-11 13:59 Nachiket Gokhale
2009-08-11 14:33 ` Teemu Likonen
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Nachiket Gokhale @ 2009-08-11 13:59 UTC (permalink / raw)
To: help-gnu-emacs
How do I delete all lines starting with
"ESPN"
And, the opposite:
How do I delete all lines not starting with
"ESPN"
Thanks in advance,
-Nachiket
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: delete non-matching lines
2009-08-11 13:59 delete non-matching lines Nachiket Gokhale
@ 2009-08-11 14:33 ` Teemu Likonen
2009-08-11 14:33 ` Pascal J. Bourguignon
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Teemu Likonen @ 2009-08-11 14:33 UTC (permalink / raw)
To: help-gnu-emacs
On 2009-08-11 06:59 (-0700), Nachiket Gokhale wrote:
> How do I delete all lines starting with
>
> "ESPN"
M-x flush-lines RET ^ESPN RET
(or its alias M-x delete-matching-lines)
> How do I delete all lines not starting with
>
> "ESPN"
M-x keep-lines RET ^ESPN RET
For more info:
C-h r m Other Repeating Search
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: delete non-matching lines
2009-08-11 13:59 delete non-matching lines Nachiket Gokhale
2009-08-11 14:33 ` Teemu Likonen
@ 2009-08-11 14:33 ` Pascal J. Bourguignon
2009-08-11 15:25 ` Xah Lee
2009-08-12 5:54 ` Martin
3 siblings, 0 replies; 6+ messages in thread
From: Pascal J. Bourguignon @ 2009-08-11 14:33 UTC (permalink / raw)
To: help-gnu-emacs
Nachiket Gokhale <gokhalen@gmail.com> writes:
> How do I delete all lines starting with
>
> "ESPN"
M-x delete-matching-lines RET ^ESPN RET
>
> And, the opposite:
>
> How do I delete all lines not starting with
>
> "ESPN"
M-x delete-matching-lines RET ^\([^E C-q C-j ]\|E[^S C-q C-j ]\|ES[^P C-q C-j ]\|ESP[^N C-q C-j ]\) RET
Or perhaps just:
M-x delete-matching-lines RET ^\([^E]\|E[^S]\|ES[^P]\|ESP[^N]\) RET
if you are lucky.
You may also use:
C-x h M-| grep ESPN RET
or
C-x h M-| grep -v ESPN RET
but this is cheating.
--
__Pascal Bourguignon__
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: delete non-matching lines
2009-08-11 13:59 delete non-matching lines Nachiket Gokhale
2009-08-11 14:33 ` Teemu Likonen
2009-08-11 14:33 ` Pascal J. Bourguignon
@ 2009-08-11 15:25 ` Xah Lee
2009-08-11 18:57 ` Nachiket Gokhale
2009-08-12 5:54 ` Martin
3 siblings, 1 reply; 6+ messages in thread
From: Xah Lee @ 2009-08-11 15:25 UTC (permalink / raw)
To: help-gnu-emacs
On Aug 11, 6:59 am, Nachiket Gokhale <gokha...@gmail.com> wrote:
> How do I delete all lines starting with
>
> "ESPN"
>
> And, the opposite:
>
> How do I delete all lines not starting with
>
> "ESPN"
LOL.
Type
Alt+x delete-matching-lines
Alt+x delete-non-matching-lines
with
^ESPN
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: delete non-matching lines
2009-08-11 15:25 ` Xah Lee
@ 2009-08-11 18:57 ` Nachiket Gokhale
0 siblings, 0 replies; 6+ messages in thread
From: Nachiket Gokhale @ 2009-08-11 18:57 UTC (permalink / raw)
To: help-gnu-emacs
On Aug 11, 11:25 am, Xah Lee <xah...@gmail.com> wrote:
> On Aug 11, 6:59 am, Nachiket Gokhale <gokha...@gmail.com> wrote:
>
> > How do I delete all lines starting with
>
> > "ESPN"
>
> > And, the opposite:
>
> > How do I delete all lines not starting with
>
> > "ESPN"
>
> LOL.
>
> Type
>
> Alt+x delete-matching-lines
> Alt+x delete-non-matching-lines
>
> with
>
> ^ESPN
>
> Xah
> ∑http://xahlee.org/
>
> ☄
Thanks, everybody.
-Nachiket
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: delete non-matching lines
2009-08-11 13:59 delete non-matching lines Nachiket Gokhale
` (2 preceding siblings ...)
2009-08-11 15:25 ` Xah Lee
@ 2009-08-12 5:54 ` Martin
3 siblings, 0 replies; 6+ messages in thread
From: Martin @ 2009-08-12 5:54 UTC (permalink / raw)
To: help-gnu-emacs
Nachiket Gokhale writes:
> How do I delete all lines starting with
>
> "ESPN"
>
> And, the opposite:
>
> How do I delete all lines not starting with
>
> "ESPN"
>
> Thanks in advance,
>
> -Nachiket
delete-matching-lines M-x ... RET
Delete lines containing matches for REGEXP.
delete-non-matching-lines M-x ... RET
Delete all lines except those containing matches for REGEXP.
Martin
--
parozusa at web dot de
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-12 5:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 13:59 delete non-matching lines Nachiket Gokhale
2009-08-11 14:33 ` Teemu Likonen
2009-08-11 14:33 ` Pascal J. Bourguignon
2009-08-11 15:25 ` Xah Lee
2009-08-11 18:57 ` Nachiket Gokhale
2009-08-12 5:54 ` Martin
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.