Page 1 of 1

Crazy "Find and Replace"

Posted: Thu Mar 01, 2007 3:05 pm
by seodevhead
Hey guys...

I have a web application that has about 100+ php files that include some function calls that need to be renamed.

Example:

$var = functionOne($string);

CHANGE TO:

$var = functionTwo($string);

So essentially I would like to somehow have my text editor (dreamweaver) 'Find and Replace':

Find: functionOne
Replace: functionTwo

Easy enough... but do I really have to open all 100+ files within dreamweaver to do it all at once? Does anyone know any software out there that can scan entire folders at once and replace any text within the text documents? Any suggestions on a workflow for this is GREATLY appreciated. Thanks.

Posted: Thu Mar 01, 2007 3:11 pm
by Adrianc333
Alot of useful results.

http://www.google.co.uk/search?hl=en&q= ... arch&meta=

Though, couldn't you just edit the actions within your function?

Posted: Thu Mar 01, 2007 3:43 pm
by RobertGonzalez
  1. Download eclipse.
  2. Start a new project with your files in it.
  3. Open one file with that function name somewhere in the file.
  4. Click on the function name once.
  5. Go to Search->Search->Replace and choose in Project (or workspace) and about 10 seconds later it is done.

Posted: Thu Mar 01, 2007 3:57 pm
by nickvd
Everah wrote:
  1. Download eclipse.
PSPad also has this ability.

Search -> Search/Replace in Files...

Posted: Thu Mar 01, 2007 3:59 pm
by Ambush Commander
Make sure you backup and have some sort of testing to ensure fatal "function doesn't exist!" errors don't popup. SVN preferred.

Posted: Thu Mar 01, 2007 4:14 pm
by seodevhead
Thanks for the tips guys.. but I think I need something a little more robust in a windows shell, that is easy to use for a dummy like me....

Anyone heard of "Actual Search & Replace"?

http://www.divlocsoft.com/

Posted: Thu Mar 01, 2007 4:36 pm
by wtf
DW has do what you are asking. When you open "find+replace" make sure your "Find in" points to a directory or wherever the files are. This will do file+replace without having to open each single file.

Posted: Thu Mar 01, 2007 4:41 pm
by seodevhead
wtf wrote:DW has do what you are asking. When you open "find+replace" make sure your "Find in" points to a directory or wherever the files are. This will do file+replace without having to open each single file.
Really? I tried it and it opens each individual file in Dreamweaver. Granted, it does perform the search and replace... but the whole "load each file into dreamweaver" is a bit excessive, especially for potentially 200+ files.

Posted: Thu Mar 01, 2007 4:59 pm
by visitor-Q
seodevhead wrote:Thanks for the tips guys.. but I think I need something a little more robust in a windows shell, that is easy to use for a dummy like me....

Anyone heard of "Actual Search & Replace"?

http://www.divlocsoft.com/
you could write a shell script. or search for an exisiting shell script.

Posted: Thu Mar 01, 2007 7:30 pm
by RobertGonzalez
I'm telling you, Eclipse handles this very efficiently without opening files.

Posted: Fri Mar 02, 2007 11:23 am
by wtf
DW has never opened files for me. It just warns me that changes to unopened files are irreversible. Can't ctrl-z it.

Posted: Fri Mar 02, 2007 11:26 am
by JayBird
Nope, dreamweaver doesn't open the files when doing a sitewide find and replace. Handles the job very nicely