[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: replace a textblock in multiple files
From: |
Jay Bingham |
Subject: |
RE: replace a textblock in multiple files |
Date: |
Tue, 26 Sep 2006 19:45:57 GMT |
On Tuesday, September 26, 2006 6:18 AM Christian wrote:
> 1) i want to work on several subdirectories, not only in one
> directory
> 2) i want to replace blocks consisting of more
> than one line.
> is that possible at all
> p.s. i know it's always possible with programming elisp. but
> i want to know if it's possible with simple emacs commands
Yes, it can be done. You did not say which version of Emacs you are
running, that might make a difference. That said here is how I would
do it if I were running version 21.3.
Load the ibuffer.el package, load the dired-x.el package.
The ibuffer.el package is available from:
www.shootybangbang.com/software/ibuffer.el
The dired-x.el package is a part of Emacs but must be explicitly
loaded/enabled in your .emacs.
Once you have these to packages active you can use the % g dired
command to locate the files that contain block of text you want to
replace. Then you can use the C-u F dired command to load the files.
Once the files are loaded invoke ibuffer and use the / c command to
limit the view to files containing the block of text. Then use the t
command to mark all the files. Finally use the U command to replace
the block of text defined by a regular expression with the new text.
There may be other ways to do this, but this is the easiest way that
I know of using simple emacs commands.
Good Luck,
__
J_)
C_)ingham
_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
RE: replace a textblock in multiple files,
Jay Bingham <=