Another quick untested idea. How about just using explorer to sort file
types/names you want to use UEdit on. Then highlight and *move* them to
another empty subdirectory (move is fast as opposed to copy). Use UEdit to
modify only this subdirectory (be sure to tell UEdit which subdirectory to
restrict itself to). Then move them back to the original directory.
Ray Pass <raypass@WORLDNET.ATT.NET>@listserv.vt.edu> on 06/28/2000 08:07:18
Please respond to Ray Pass <raypass@WORLDNET.ATT.NET>
Sent by: "SAS(r) Discussion" <SAS-L@listserv.vt.edu>
Subject: Re: UltraEdit "Replace in Files"
Tom (original request below),
Now that we know why you're getting the results you're getting, the
question becomes, how do you get what you want? Here's one way, albeit a
bit kludgy. Can anybody do better?
1) Note all the file extensions which would be undesirably included when
looking for *.SAS, such as
.SASv7bDAT, .SASv7bCAT. You can use Windows Explorer and sort by file
2) Temporarily rename all of these files so they will not have extensions
starting with .SAS - like .XSASv7bDAT, .XSASv7bCAT for example. If there
are only a few, do it by hand. If there are many, build a macro in SAS to
do it. Have the macro execute operating system commands to first get all
the file names in a string (DIR) and then step through the string
incrementally to do the renaming.
3) Do the UltraEdit Replace in Files.
4) Change the temporarily renamed files back to their original names with a
revised version of the macro you built in step 2), or by hand if there are
As I said, this is a bit kludgy, but it should work. I'll bet there's a
much more elegant way out there. Anybody?
Apologies if this seems off-topic, but I think it is important. Recently
> I queried SAS-L about how to do a global "search & replace", covering an
> entire directory. Several people steered me to UltraEdit, and its
> "Replace in Files" capability. Well, I just tried to globally change a
> text string in "*.SAS" datasets (i.e. my programs) ... but the process
> seemed to be taking too long, so I aborted it. I then found that, in
> addition to my SAS programs, UltraEdit was apparently going through ALL
> files, in the given directory, whose extension *began* with SAS, i.e. my
> SAS v8 data and catalog files (*.SASv7bDAT, *.SASv7bCAT). This is
> obviously undesired and extremely dangerous behavior! Did I miss an
> option somewhere that would have restriced the search-and-replace to
> datasets alone? The version of UltraEdit I'm using is "UltraEdit-32
> Professional Text/HEX Editor, Version 7.10a". Thanks,
| Ray Pass, Ph.D. voice: (914) 693-5553 |
| Ray Pass Consulting eFax: (914) 206-3780 |
| 5 Sinclair Place |
| Hartsdale, NY 10530 e-mail: email@example.com |