* replace a textblock in multiple files
@ 2006-09-25 16:55 C.Strobl
0 siblings, 0 replies; 3+ messages in thread
From: C.Strobl @ 2006-09-25 16:55 UTC (permalink / raw)
hello all,
only a short and simple question: whats the best way to replace a
textblock in multiple files.
thanks and i hope the question is not to easy
christian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: replace a textblock in multiple files
[not found] <mailman.7384.1159203371.9609.help-gnu-emacs@gnu.org>
@ 2006-09-26 0:52 ` Benjamin Rutt
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Rutt @ 2006-09-26 0:52 UTC (permalink / raw)
<C.Strobl@dlr.de> writes:
> hello all,
> only a short and simple question: whats the best way to replace a
> textblock in multiple files.
> thanks and i hope the question is not to easy
> christian
M-x dired
mark desired files with 'm'
Q
--
Benjamin Rutt
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: replace a textblock in multiple files
@ 2006-09-26 19:45 Jay Bingham
0 siblings, 0 replies; 3+ messages in thread
From: Jay Bingham @ 2006-09-26 19:45 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-26 19:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-25 16:55 replace a textblock in multiple files C.Strobl
[not found] <mailman.7384.1159203371.9609.help-gnu-emacs@gnu.org>
2006-09-26 0:52 ` Benjamin Rutt
-- strict thread matches above, loose matches on Subject: below --
2006-09-26 19:45 Jay Bingham
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).