469,360 Members | 1,600 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

global search and replace tool

I am in search of a free tool which can replace multiple strings on
the particular directory . Please let me know if any such , written in
perl.
Thanks
Athresh
Jul 19 '05 #1
4 3930
Tandem person wrote:
I am in search of a free tool which can replace multiple strings on
the particular directory . Please let me know if any such , written in
perl.


I think you will have to explain a bit more what you are talking about.
Directories (at least in the typical standard operating systems) are mere
lists of files (in the broadest meaning) and
at least I can't see where strings and directories have anything to do with
each other.

jue
Jul 19 '05 #2
Hi specification is as below.

I have few function calls that has to be changed to the new one in the
whole source files ,present in a single directory. Please let me know
if any such tools available.
"Jürgen Exner" <ju******@hotmail.com> wrote in message news:<eU*******************@nwrddc02.gnilink.net>. ..
Tandem person wrote:
I am in search of a free tool which can replace multiple strings on
the particular directory . Please let me know if any such , written in
perl.


I think you will have to explain a bit more what you are talking about.
Directories (at least in the typical standard operating systems) are mere
lists of files (in the broadest meaning) and
at least I can't see where strings and directories have anything to do with
each other.

jue

Jul 19 '05 #3


Tandem person wrote:
Hi specification is as below.

I have few function calls that has to be changed to the new one in the
whole source files ,present in a single directory. Please let me know
if any such tools available.
"Jürgen Exner" <ju******@hotmail.com> wrote in message news:<eU*******************@nwrddc02.gnilink.net>. ..
Tandem person wrote:
I am in search of a free tool which can replace multiple strings on
the particular directory . Please let me know if any such , written in
perl.


I think you will have to explain a bit more what you are talking about.
Directories (at least in the typical standard operating systems) are mere
lists of files (in the broadest meaning) and
at least I can't see where strings and directories have anything to do with
each other.

jue


perl -p -i -e 's/Oldname/Newname/' /pathToDir/*

Jul 19 '05 #4
Tandem person wrote:
I have few function calls that has to be changed to the new one in the
whole source files ,present in a single directory. Please let me know
if any such tools available.


In general you will need a fully-fledged parser for your particular
programming language in order to parse the source code of that programming
language. Otherwise you are running the risk that in addition to the desired
function calls other text pieces may be changed, too, if they happen to have
or contain the same character sequence (e.g. in a string or as part of the
name of some other function) .

If you think in your particular situation you can accept that risk then
please have a look at
- "perldoc -f glob" or "perldoc -f readdir" about how to get the names
of all files in a directory
- "perldoc perlop" for information about the "s" operator
("substitute"); maybe "perldoc perlre" for information about regular
expressions
- and "perldoc -q change" for the FAQ entry about "How do I change one
line in a file[...]?"

jue
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jane Doe | last post: by
1 post views Thread by Zenobia | last post: by
2 posts views Thread by Michael Peters | last post: by
reply views Thread by Jared | last post: by
6 posts views Thread by simon.robin.jackson | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.