Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > global search and replace tool

Reply
Thread Tools

global search and replace tool

 
 
Tandem person
Guest
Posts: n/a
 
      10-22-2003
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
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      10-22-2003
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


 
Reply With Quote
 
 
 
 
Tandem person
Guest
Posts: n/a
 
      10-23-2003
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" <> wrote in message news:<eUxlb.52451$>. ..
> 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

 
Reply With Quote
 
Donald 'Paddy' McCarthy
Guest
Posts: n/a
 
      10-23-2003


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" <> wrote in message news:<eUxlb.52451$>. ..
>
>>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/*

 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      10-23-2003
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
| SEO , Search Engine Optimizer, SEARCH OPtiMIzAtIoN with SeaRch OPtiMizer optimizer.seo@gmail.com Digital Photography 0 04-22-2007 04:20 AM
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 1 10-25-2006 06:50 PM
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 0 10-25-2006 01:04 PM
msn search tool & plishing tool Kue2 Windows 64bit 1 09-02-2005 02:29 PM
Search Replace Tool Bob N. HTML 12 01-03-2004 03:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57