From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Carmody Newsgroups: gmane.emacs.help Subject: Re: How to apply a list of regex replaces to multiple files? Date: Tue, 01 Jul 2008 10:33:41 +0300 Organization: Saunalahti Customer Message-ID: <871w2eukh6.fsf@nonospaz.fatphil.org> References: <091f39ab-89ac-438f-a878-464309c4a8f6@i18g2000prn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1214898089 19224 80.91.229.12 (1 Jul 2008 07:41:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Jul 2008 07:41:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 01 09:42:15 2008 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 1KDaV9-00041z-Uf for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jul 2008 09:42:12 +0200 Original-Received: from localhost ([127.0.0.1]:58552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KDaUJ-0007ns-HE for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jul 2008 03:41:19 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.news-service.com!newsfeed1.swip.net!newsfeed1.funet.fi!newsfeeds.funet.fi!feeder1.news.saunalahti.fi!reader1.news.saunalahti.fi!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:9JuVTawNfwSm1vMCV5N11EeEd9Y= Original-Lines: 20 Original-NNTP-Posting-Host: 83.143.57.195 Original-X-Complaints-To: newsmaster@saunalahti.com Original-X-Trace: reader1.news.saunalahti.fi 1214897629 83.143.57.195 (Tue, 01 Jul 2008 10:33:49 EEST) Original-NNTP-Posting-Date: Tue, 01 Jul 2008 10:33:49 EEST Original-Xref: news.stanford.edu gnu.emacs.help:159819 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:55172 Archived-At: "michael.l" writes: > I've browsed the messages here and have googled but don't see a clear > solution yet. I have about 900 documents to which I need to apply a > list of maybe 40 separate regex search and replaces. I would like to > feed a list of the regex expressions and replacements to emacs and > have it applied to a directory of the files. Any solutions? Keyboard > macros don't seem like the right solution.... Emacs is an interactive editor, most of the time in order to achieve some modification of a file, you need to interact with it. Have you considered simply using `find' and `sed' (or even 'perl') from the command line instead of an interactive editor. They sound more like the right tool for the job. Phil -- Dear aunt, let's set so double the killer delete select all. -- Microsoft voice recognition live demonstration