Bug in "Find In Files" filter of Notepad++ 8.2.1 (x64)
-
Found a bug in the “Find in Files” filter, when searching for files that contain blanks in the file name, e.g.
SAP 7.70*.xml
The search results in 0 files found…
Search “7” (0 hits in 0 files of 0 searched)When I instead then search for SAP*.xml it properly finds files:
Search “7” (13 hits in 12 files of 13 searched)but in this case unfortunately the hits also contain results from SAP 7.60*.xml (which should not be contained in the search, e.g.).
C:\UEMConfig\T\general\FlexRepository\Shortcut\SAP 7.60 Netweaver - SAPLogon.xml (1 hit)
C:\UEMConfig\T\general\FlexRepository\Shortcut\SAP 7.70 Netweaver - Analysis for Microsoft Excel.xml (1 hit)What I originally wanted to do is replace 7.60 by 7.70 in all SAP 7.70*.xml files, whis is impossible with the current Notepad++ 8.2.1 version (cross checked with the 8.2.2 rc5 release that the issue is still present in the most recent developer release)
-
I suppose it is a “bug” although I call it a “limitation”. :-)
It’s a limitation because a space is used as a delimiter in the Filters box, e.g.,
*.txt *.log
<-- see the space between?The best you may be able to do is replace any spaces with
?
, e.g.SAP?7.70*.xml
in your case. -
@cwallner said in Bug in "Find In Files" filter of Notepad++ 8.2.1 (x64):
Found a bug in the “Find in Files” filter, when searching for files that contain blanks in the file name,
Interesting timing. Just a few days ago, this was talked about in NPP issue#11086, where the developer confirmed that it was the intended behavior (that is, not a bug). To handle spaces in filenames in the Filters entry field, you need to use wildcards instead of the space characters.
That discussion was propagated to the User Manual repository as usermanual issue#311, and I have added verbiage to the User Manual to the effect of:
Find in Files
…
- Wildcards can include
*
for zero or more of any character, and?
for exactly one of any character. - Most characters work as literals. However, space is used as the separator, and thus cannot be used as a literal in your filter. Some punctuation characters have special meanings (like the
?
and*
wildcards, or the!
exclusion or!+\
for recursive exclusion), and cannot be used as literals. Also, the;
causes problems, so even though Microsoft allows it in file and path names, using a;
in the Filters box will not work as you might hope. If you want to match a space or a semicolon;
or other problematic-punctuation in your file or folder for your Filter (whether for inclusion or exclusion), then use the*
and/or?
wildcards instead. (Sox?y.txt
will match the filex;y.txt
orx y.txt
(with a space betweenx
andy
).)
This new wording will be in the next release of npp-user-manual.org’s Searching > Find in Files section.
- Wildcards can include
-
@PeterJones
if separation of multiple filters is the intended behavior for blanks in the filter, why not allow double quotes for search strings that should contain blanks in the file name. Double quotes are not allowed for file names in neither unix nor Windows file systems whereas blanks or single quotes are…
when I used “SAP 7.70*.xml” it also did not return a proper result… -
Probably should add a note to the manual to the effect that double quotes don’t work in the applicable Find window boxes…
-
@alan-kilborn
Would it be fine to raise a feature request for the filters field then, to allow using double quotes to mask any search criteria containing blanks? Double quotes are more or less common standard for this kind of masking blanks in searches or actions (even google search allows double quotes for this case, so they are not only being used for file system related actions in OS)… -
@cwallner said in Bug in "Find In Files" filter of Notepad++ 8.2.1 (x64):
Would it be fine to raise a feature request for the filters field then,
Sure, you can ask for anything you’d like in a feature request.
You do that by following the advice HERE. -
have opened a new issue on github
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11155