help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Removing lines that match a pattern


From: Peter Brown
Subject: Re: [h-e-w] Removing lines that match a pattern
Date: Fri, 2 Nov 2001 10:09:49 -0500 (EST)

if you have cygwin-like tools installed, you can do

C-u M-| grep <insert your regexp here>

i.e., shell commmand (grep) on region, to keep lines matching the regexp

...use grep -v to remove matching lines

PB>>

On Fri, 2 Nov 2001, Moore, Mathew L wrote:

> I would like to remove the lines of a (very long) file that start with a
> specific pattern.  Do I need to write a lisp function, or does anyone know a
> way to do it with regexp?
>
> I've tried
>
>   Replace regexp: SOME HEADER\(.*\) with:
>
> (just hitting RET after the with), but this only removes the text of the
> line, not the line itself.
>
> Unfortunately, I don't know Emacs Lisp, but maybe this is a good time to
> start learning?
>
> Thanks for all your help,
> --Matt
>

-- 
Peter Brown                 Senior Software Engineer
Dept. of Computer Science        140 Governors Drive
University of Massachusetts   Amherst, MA 01003-4610
Phone: (413) 577-2505            Fax: (413) 545-1249
address@hidden  http://www.cs.umass.edu/~pbrown






reply via email to

[Prev in Thread] Current Thread [Next in Thread]