From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "michael.l" Newsgroups: gmane.emacs.help Subject: Re: How to apply a list of regex replaces to multiple files? Date: Mon, 30 Jun 2008 22:56:22 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <091f39ab-89ac-438f-a878-464309c4a8f6@i18g2000prn.googlegroups.com> <85k5g6jhz9.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1214894445 7678 80.91.229.12 (1 Jul 2008 06:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Jul 2008 06:40:45 +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 08:41:29 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 1KDZYN-0003vA-HW for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jul 2008 08:41:27 +0200 Original-Received: from localhost ([127.0.0.1]:52248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KDZXX-0002YS-6V for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jul 2008 02:40:35 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v1g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: 76.174.14.56 Original-X-Trace: posting.google.com 1214891783 5480 127.0.0.1 (1 Jul 2008 05:56:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 1 Jul 2008 05:56:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v1g2000pra.googlegroups.com; posting-host=76.174.14.56; posting-account=JNyrwAoAAADXzolAUFxm7I3DGNXWS1dw User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9; Google-TR-3) Gecko/2008061004 Firefox/3.0, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:159817 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:55170 Archived-At: On Jun 30, 10:23=A0pm, David Kastrup wrote: > "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 Thank you David; hadn't come across that yet. Is there a way to input the entire list of regex replacements rather than doing each from the minibuffer? And will this mean typing "!" 900 times? I'm just learning emacs.