unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to apply a list of regex replaces to multiple files?
Date: Tue, 01 Jul 2008 07:23:06 +0200	[thread overview]
Message-ID: <85k5g6jhz9.fsf@lola.goethe.zz> (raw)
In-Reply-To: 091f39ab-89ac-438f-a878-464309c4a8f6@i18g2000prn.googlegroups.com

"michael.l" <michael.lommel@gmail.com> 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, <menu-bar> <operate> <query-replace>.

(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


  reply	other threads:[~2008-07-01  5:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01  1:50 How to apply a list of regex replaces to multiple files? michael.l
2008-07-01  5:23 ` David Kastrup [this message]
2008-07-01  5:56   ` michael.l
2008-07-01  7:01 ` Tim X
2008-07-01  7:33 ` Phil Carmody
2008-07-01  8:38 ` Lennart Borgman (gmail)
     [not found] ` <mailman.14069.1214901523.18990.help-gnu-emacs@gnu.org>
2008-07-01 15:09   ` michael.l
2008-07-01 17:39     ` Joel J. Adamson
2008-07-02  8:20     ` Tim X
2008-08-01  8:38       ` David Combs
2008-07-01 23:25 ` Xah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85k5g6jhz9.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).