Search and Replace over multiple files without opening them

Find, replace, find in files, replace in files, regular expressions

Search and Replace over multiple files without opening them

Postby RedMage » Tue Apr 26, 2005 5:32 pm

Hi,
I'm interested in this product, but I would like to know if it allows me to search and replace over multiple files without opening them. I tell it what directory to look at, and it will do the search and replace recursively (for subdirectories if needbe)

Basically, I'm looking for functionality that acts like Homesite's search and replace. Does UltraEdit do this?

From searching these forums, I get the impression that this is not possible. From what I understand, I have to create a macro with one file, save the macro, open up batches of files, and then run this macro over the open files. This isn't really what I want.

Thank you for reading.
User avatar
RedMage
Newbie
 
Posts: 2
Joined: Mon Apr 25, 2005 11:00 pm

Re: Search and Replace over multiple files without opening them

Postby mrainey56 » Tue Apr 26, 2005 8:04 pm

UE has a Replace In Files command that will replace text in designated files in a directory, and optionally, in all subdirectories.


Image
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Search and Replace over multiple files without opening them

Postby RedMage » Tue Apr 26, 2005 9:11 pm

This sounds like what I want. Thanks for this answer.
User avatar
RedMage
Newbie
 
Posts: 2
Joined: Mon Apr 25, 2005 11:00 pm

Re: Search and Replace over multiple files without opening them

Postby philiptdotcom » Wed Feb 15, 2006 8:11 pm

Okay, but how do you do this for HEX VALUES????

Any help would be much appreciated!!

Thanks,
philiptdotcom
User avatar
philiptdotcom
Newbie
 
Posts: 1
Joined: Wed Feb 15, 2006 12:00 am

Re: Search and Replace over multiple files without opening them

Postby Mofi » Thu Feb 16, 2006 8:34 am

philiptdotcom wrote:Okay, but how do you do this for HEX VALUES????


What exactly would you need? Give us an example which shows everything important. Maybe it could be also done with Replace In Files. Hex values can be represented by normal characters (except 00) in the find and replace field. If this is not possible, it could be done with a macro.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4056
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Search and Replace over multiple files without opening them

Postby srivastava » Sun Mar 19, 2006 8:27 am

I have large number of files and I want to find MODE=1 and replace them with MODE=0. The file names have pattern something like *dc.raw. How can I do so without opening the file and through a batch file?
User avatar
srivastava
Newbie
 
Posts: 2
Joined: Sun Mar 19, 2006 12:00 am

Re: Search and Replace over multiple files without opening them

Postby Mofi » Sun Mar 19, 2006 3:26 pm

Hi srivastava!

With the Replace In Files command from the menu Search. Open this dialog and the rest should be self-explaining. If it is not self-explaining for you, please press the Help button in this dialog and read the help.

If you do not have a Search menu with menu item Replace In Files you currently use the Basic menu. Open File - Configuration - section Toolbars / Menus - Management and select with the 2 manage buttons the Advanced menu and toolbar.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4056
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Search and Replace over multiple files without opening them

Postby srivastava » Sun Mar 19, 2006 4:52 pm

From menu, I can follow and do it but how to it through a batch file without start uedit32. I mean like you can open a file as below

uedit32 filename

How do I execute this command in a batch file so that uedit is invoked and does this job?
User avatar
srivastava
Newbie
 
Posts: 2
Joined: Sun Mar 19, 2006 12:00 am

Re: Search and Replace over multiple files without opening them

Postby Mofi » Mon Mar 20, 2006 7:04 am

Record the search and replace into a macro. Save the macro to a file and use following command line option in your batch file.

start "ModeReplace" /wait "C:\Program Files\UltraEdit-32\uedit32.exe" "filename" /M,E,1="full path of macro file/macro name"

But much more easier would be in your case (replace in a batch file) to use the free search and replace tool Xchang32.exe from Clay's Utilities for Win32 which is a 32 bit console application which returns error codes.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4056
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions