www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/15/09:30:13

Date: Wed, 15 Mar 2000 10:53:41 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: leon <Leon AT caresystems DOT com DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: search and replace on multiple files
In-Reply-To: <38CEBD63.2892212F@caresystems.com.au>
Message-ID: <Pine.SUN.3.91.1000315105214.17230P-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 15 Mar 2000, leon wrote:

> Go to the command prompt, and then to the directory containing
> the files. do 'vim *.*' (w/o the quotes of course), then map a
> key, say, z as ':map z :%s/hello/good by/g<C-v><C-m>:w<C-v><C-
> m>:n<C-v><C-m>Z' along with the mapping ':map Z z'

Seems like it's too complicated in vim.  Emacs does this much easier
(IMHO).  Or use Perl, as someone suggested, if you are sure that all
files need to be unconditionally edited.  For simple non-interactive 
replaces, a simple batch file or a shell script which loops through all 
the files and edits them with Sed would be enough as well.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019