From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: How to apply a list of regex replaces to multiple files? Date: Tue, 01 Jul 2008 07:23:06 +0200 Organization: Organization?!? Message-ID: <85k5g6jhz9.fsf@lola.goethe.zz> 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 1214890880 30721 80.91.229.12 (1 Jul 2008 05:41:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Jul 2008 05:41:20 +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 07:42:06 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 1KDYcs-0007gM-Bf for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jul 2008 07:42:02 +0200 Original-Received: from localhost ([127.0.0.1]:43894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KDYc1-0002ro-Ej for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jul 2008 01:41:09 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed.freenet.de!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:zewzpeDMzex0WWN4/yFPXbBEEKM= Original-Lines: 24 Original-NNTP-Posting-Date: 01 Jul 2008 07:23:06 CEST Original-NNTP-Posting-Host: c2c6428c.newsspool3.arcor-online.net Original-X-Trace: DXC=_WP]]=Q?5__PU8j_I0DN6_McF=Q^Z^V3X4Fo<]lROoRQ8kF5MOK`; S:bhJ\jG^V4PoFXBU5c?U[JALObP Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: news.stanford.edu gnu.emacs.help:159816 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:55169 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.... dired-do-query-replace-regexp is an interactive compiled Lisp function in `dired-aux.el'. It is bound to Q, . (dired-do-query-replace-regexp FROM TO &optional DELIMITED) Do `query-replace-regexp' of FROM with TO, on all marked files. Third arg DELIMITED (prefix arg) means replace only word-delimited matches. If you exit (C-g, RET or q), you can resume the query replace with the command M-,. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum