I am running into an oddity that makes my searches take much longer than they need to. I am trying to search files named .sas. However, there are other files on the disk names .sas7bdat, which it is also searching, when I don't want it to. How can I exclude the .sas7bdat files when I'm searching .sas files? I've tried adding a trailing space after the .sas, and putting the specification in double-quotes. The trailing space does nothing, and quoting the spec throws a bad file pattern error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just discovered the "Exclusions" option in the latest ver of AstroGrep, and that is covering me for now. However, I still think that the file types specification entry could use some tightening up. For example .sas shouldn't match .sas7bdat. If I were to enter .sas, then I would expect it to match any extension that started with .sas.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This forum is stripping asterisks and turning them into italics, so the above post looks screwy. What I meant in that last sentence is that if I add a wildcard to the extension .sas, then I would expect it to match .sas7bdat.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm, looking at the .Net specification, there is a note about matching using the file filter.
Here is the note:
When using the asterisk wildcard character in a searchPattern, such as ".txt", the matching behavior when the extension is exactly three characters long is different than when the extension is more or less than three characters long. A searchPattern with a file extension of exactly three characters returns files having an extension of three or more characters, where the first three characters match the file extension specified in the searchPattern. A searchPattern with a file extension of one, two, or more than three characters returns only files having extensions of exactly that length that match the file extension specified in the searchPattern. When using the question mark wildcard character, this method returns only files that match the specified file extension. For example, given two files, "file1.txt" and "file1.txtother", in a directory, a search pattern of "file?.txt" returns just the first file, while a search pattern of "file.txt" returns both files.
Seems like when using *.sas it is doing what is specified, but it might not be what you want.
I'll create a request to look into this more.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree that it does appear to be working as specified. I just don't understand why the specification would be written this way. This is also how it works at the Win7 command line. Funky spec, IMO.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am running into an oddity that makes my searches take much longer than they need to. I am trying to search files named .sas. However, there are other files on the disk names .sas7bdat, which it is also searching, when I don't want it to. How can I exclude the .sas7bdat files when I'm searching .sas files? I've tried adding a trailing space after the .sas, and putting the specification in double-quotes. The trailing space does nothing, and quoting the spec throws a bad file pattern error.
Can you also list out or take a screen shot of the search options you have selected. Thanks!
AstroGrep ver 4.1.4
search path: m:\customer\customer1
file types: *.sas
search text: metercals
Options (only ones checked; others are not):
Search subfolders
Line Numbers
Context lines: 0
If I select "Whole Word", will that apply to the file name as well?
Thanks for the quick response!
D
I just discovered the "Exclusions" option in the latest ver of AstroGrep, and that is covering me for now. However, I still think that the file types specification entry could use some tightening up. For example .sas shouldn't match .sas7bdat. If I were to enter .sas, then I would expect it to match any extension that started with .sas.
Thanks for the replies. I agree with your assumption and will try to find out what is going on.
Also, whole word is used against the search text and nothing else.
This forum is stripping asterisks and turning them into italics, so the above post looks screwy. What I meant in that last sentence is that if I add a wildcard to the extension .sas, then I would expect it to match .sas7bdat.
Hmm, looking at the .Net specification, there is a note about matching using the file filter.
Here is the note:
When using the asterisk wildcard character in a searchPattern, such as ".txt", the matching behavior when the extension is exactly three characters long is different than when the extension is more or less than three characters long. A searchPattern with a file extension of exactly three characters returns files having an extension of three or more characters, where the first three characters match the file extension specified in the searchPattern. A searchPattern with a file extension of one, two, or more than three characters returns only files having extensions of exactly that length that match the file extension specified in the searchPattern. When using the question mark wildcard character, this method returns only files that match the specified file extension. For example, given two files, "file1.txt" and "file1.txtother", in a directory, a search pattern of "file?.txt" returns just the first file, while a search pattern of "file.txt" returns both files.
Seems like when using *.sas it is doing what is specified, but it might not be what you want.
I'll create a request to look into this more.
I agree that it does appear to be working as specified. I just don't understand why the specification would be written this way. This is also how it works at the Win7 command line. Funky spec, IMO.
I created bug ticket #45 for this issue.