Too many files searched by Find in Files process

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

Too many files searched by Find in Files process

Postby JangoFolly » Wed Feb 13, 2008 9:00 pm

Hi. In the Find in Files dialog, I'm specifying that all files named "*.sas" be searched for a particular string. What's actually being searched are all files with an extension that begins with ".sas" (e.g., "*.sas7bdat").

Is there any way to limit the search to only those files which have exactly the extension ".sas". The additional unwanted files are giant binary data sets, which is turning my already sizeable search into a never-ending search.

Thank you.


Regards,
User avatar
JangoFolly
Newbie
 
Posts: 2
Joined: Wed Feb 13, 2008 12:00 am

Re: Too many files searched by Find in Files process

Postby Mofi » Thu Feb 14, 2008 8:46 am

See topic Duplicate results in Find in Files and the linked articles there why that happens.

It is not possible yet to specify an exclude filter to find all files matching *.sas but not files matching *.sas7bdat. I would be really interested in how Microsoft has solved this problem for their Windows Explorer. Looks like the MS developers have written a special filter for Windows Explorer. Maybe this is the reason why Windows Explorer needs much longer for file searches as for example Total Commander.

Maybe there is another criteria in the file name of the files with extension sas which you can use to exclude the files with the extension sas7bdat.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Too many files searched by Find in Files process

Postby JangoFolly » Thu Feb 14, 2008 12:02 pm

Thank you for your reply, Mofi.

The files I want to search are text, and the unwanted files are binary -- could that be a filtering criteria (although there is obviously no such selection in the Find in Files dialog).


Regards,
User avatar
JangoFolly
Newbie
 
Posts: 2
Joined: Wed Feb 13, 2008 12:00 am

Re: Too many files searched by Find in Files process

Postby Mofi » Thu Feb 14, 2008 1:43 pm

No, the file content type cannot be specified as search criteria.

What about using Windows Explorer to find files with extension sas only, select all files in the last and then drag and drop that files into the UltraEdit window. Then you can run a search in open files. If you have not thousands of *.sas files this is a possible workaround.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Too many files searched by Find in Files process

Postby Jane » Thu Feb 14, 2008 4:07 pm

I noticed something interesting when playing with this problem. I have a directory filled with *.TXT files.
I shortened one file extension to TX and lengthened one to TXTEST. If I do a search in files named *.TX
it only looks in that one file, it doesn't touch the TXT files.

If I do a search in *.TXT, it searches all the*.TXT files as well as the *.TXTEST file. If I search files *.TXTE it searches NOTHING, not even *.TXTEST. If I search for *.TXTE* it will then search *.TXTEST.
It appears that only if you are searching for a 3 letter extension will it extend the search reach to include all files with extensions that start with these 3 letters; perhaps related to the old DOS rule of extension max 3 letters?

Anyway, you could use this to your advantage -for example temporarily name the *.SAS file to *.SA using Bulk Rename Utility http://www.bulkrenameutility.co.uk/Main_Intro.php or something similar and do the searches, then rename them back.

Worth a try,
Jane
User avatar
Jane
Basic User
Basic User
 
Posts: 22
Joined: Sat Aug 05, 2006 11:00 pm
Location: Canada


Return to Find/Replace/Regular Expressions