LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 Jun 2000 10:58:30 -0600
Reply-To:     Mark S Dehaan/MSD/CC01/INEEL/US <MSD@INEL.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mark S Dehaan/MSD/CC01/INEEL/US <MSD@INEL.GOV>
Subject:      Re: UltraEdit "Replace in Files"
Content-type: text/plain; charset=us-ascii

Tom,

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.

HTH, Mark DeHaan

Ray Pass <raypass@WORLDNET.ATT.NET>@listserv.vt.edu> on 06/28/2000 08:07:18 AM

Please respond to Ray Pass <raypass@WORLDNET.ATT.NET>

Sent by: "SAS(r) Discussion" <SAS-L@listserv.vt.edu>

To: SAS-L@LISTSERV.VT.EDU cc:

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 type.

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 not many.

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?

Ray

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 my > 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 *.SAS > 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: raypass@att.net | *------------------------------------------------*


Back to: Top of message | Previous page | Main SAS-L page