From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: How to kill line beginning with specific string Date: Thu, 19 Nov 2009 10:47:38 +0200 Organization: SunSITE.dk - Supporting Open source Message-ID: <87vdh6sxxx.fsf@kobe.laptop> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258631058 31784 80.91.229.12 (19 Nov 2009 11:44:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 11:44:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 12:44:11 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NB5Ql-0001kz-ME for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 12:44:07 +0100 Original-Received: from localhost ([127.0.0.1]:58850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NB5Ql-0007MT-87 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 06:44:07 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!goblin2!goblin.stu.neva.ru!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) Cancel-Lock: sha1:1ZAuxv0J2oOkTrv3IC14i/bmexU= Original-Lines: 20 Original-NNTP-Posting-Host: 94.64.253.167 Original-X-Trace: news.sunsite.dk DXC=6eXoWhc^X`jJfJcgG; Q1FaYSB=nbEKnkkVi3W\`WUg<`1joJZA^dLN@mmcXT5n6kBWClR5oTQVJGaEiaK7Y; 2KH1Zi Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:174839 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69913 Archived-At: On Wed, 18 Nov 2009 10:51:29 -0800 (PST), brooklynwhite wrote: > I need to figure out how to kill a series of lines in a text file that all > begin with the same string. The format of the lines is: > > 2000 001 00 AIR TEMP 354 > > The second and third expressions in the line change with subsequent > lines, e.g.: > > 2000 002 01 AIR TEMP 354 > > Is there a simple way for me to search for and kill all of these lines > without having to repeatedly enter the search mode and type ctrl-k > when the line is found? I realize this may be a silly question so > thanks for your patience and help. You can use `M-x flush-lines RET'. Note that the `flush-lines' argument is a regular expression, but it should work fine for simple string matching too.