Page 1 of 1 1
Topic Options
#165083 - 2006-07-26 05:40 PM Search and Replace on multiple files
thorpen Offline
Lurker

Registered: 2006-01-09
Posts: 1
I need a script where I can pass it a string to search for and a string to replace with and then get the script to search through multiple files in various sub directories - any help ??

Thanks Nick.

Top
#165084 - 2006-07-26 05:43 PM Re: Search and Replace on multiple files
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
search and replace:
$newstring = join(split($oldstring,$oldvar),$newvar)

Quote:

multiple files in various sub directies



pray, elaborate...

Top
#165085 - 2006-07-26 07:06 PM Re: Search and Replace on multiple files
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Maybe you need something like these

http://www.funduc.com/search_replace.htm

http://www.htmlworkshop.com/

http://www.rjlsoftware.com/software/utility/search/

Top
#165086 - 2006-07-26 09:07 PM Re: Search and Replace on multiple files
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
My Qreplace.exe ( http://home.comcast.net/~habullock/Perlutilities.htm ) can replace text in multiple files using filespec wildcards where the files are in one directory if that is of any help.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#165087 - 2006-07-26 09:26 PM Re: Search and Replace on multiple files
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Doesn't sound like it Howard

Quote:

various sub directories




KiX can do it, but if he really has a lot to do then maybe some dedicated util might be better/faster.

Top
#165088 - 2006-07-27 05:02 AM Re: Search and Replace on multiple files
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
A loop with directories passed to the Qreplace. You just have to call it for each directory.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.138 seconds in which 0.112 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org