[wplug] Find and Replace
Edward C. Smith
edward.smith at forum.com
Fri Nov 15 04:06:32 EST 2002
Check out Freshmeat for srsed. It's an interface to sed that filters multiple files into it and can use regex to make changes.
I use it fairly often.
-Ed
On 15 Nov 2002 05:27:13 -0500
J Aaron Farr <jaaronfarr at yahoo.com> wrote:
> Hello.
>
> Both my shell scripting and perl skills are really poor, so I'm looking
> for a suggestion here:
>
> What I'm want is a simple script that will do a find and replace over a
> number of files. Specifically I've got a bunch of FORTRAN files and I
> want to easily change a variable declaration like "N=10" to "N=20". So
> assuming I have all the files I want to change in my working directory,
> then I should be able to run some command like:
>
> replace.sh *.for
>
> Where I would edit the strings I want to search and replace in
> replace.sh. I suppose that could also be sent via command line.
>
> I know there should be simple ways to do this with perl, or even
> ed,ex,sed,or awk. I'm just not sure what would be the simplest. Any
> suggestions?
>
> --
> jaaron <jaaronfarr at yahoo.com>
>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
--
Edward C. Smith
Programmer
Interactive Media Corp
Butler, PA
More information about the wplug
mailing list