Home Download Buy Blog Forum Support

Search and replace in all files

Search and replace in all files

Postby shaker on Tue Aug 02, 2011 9:30 am

Is it possible to do a search and replace in all files? I haven't figured out how to do that.
shaker
 
Posts: 3
Joined: Tue Aug 02, 2011 7:57 am

Re: Search and replace in all files

Postby adzenith on Tue Aug 02, 2011 4:12 pm

No, it's not possible. You can do a find but not a replace.
adzenith
 
Posts: 1215
Joined: Mon Oct 19, 2009 9:12 pm

Re: Search and replace in all files

Postby davepeck on Thu Aug 11, 2011 7:57 pm

+1 would love to see this feature. No editors I know of, except TextMate, really get this right.

(I'm an old-hand emacs user; lack of a meaningful multi-file F/R except via obscure dired commands is... crazy!)
davepeck
 
Posts: 1
Joined: Thu Aug 11, 2011 7:55 pm
Location: Software Developer

Re: Search and replace in all files

Postby mtin79 on Tue Aug 16, 2011 10:54 pm

+1 for find and replace in whole project
mtin79
 
Posts: 1
Joined: Tue Aug 16, 2011 10:53 pm

Re: Search and replace in all files

Postby nobleach on Wed Aug 17, 2011 12:45 am

it's as simple as doing a sed command on an entire directory or Perl if you're into that sort of thing:

sed -e "s/OLDSTRING/NEWSTRING/ig" * should get you there.

perl -p -i -e 's/oldstring/newstring/g' * will do it for Perl

On Windows, make sure you have Sed or Perl

Since we're using Python, doing a recursive regex replace shouldn't be too hard.

-Jim
nobleach
 
Posts: 48
Joined: Thu Jun 23, 2011 4:14 pm


Return to Technical Support

Who is online

Users browsing this forum: Golden_redbird and 30 guests