Comments (17)
@schadjo OK, thanks for clarifying what you meant. Yes, I see files with no extension all the time, so your use case makes a lot more sense now.
It turns out you can do this! You just need to familiarize yourself with globbing, which is discussed to some extent here. A more comprehensive guide could be found by googling glob syntax
.
What you want to do is put the filter !*.?*
(which excludes all files with at least one character in their extension) in the Filters
box.
If you want to restrict which files without extensions you look at, you can just add those filters separately. So *2 !*.?*
would search for all extensionless files with names that end with the digit 2
from notepad-plus-plus.
::FindFirstFile
and ::FindNextFile
functions seem to be doing what is desired when searching for e.g. *.
.
( In fact, for experimenting with these in an easy manner, I found THIS really cool Python program from a StackOverflow answer. )
After a little bit more looking, the problem appears to be in the use of the ::PathMatchSpec
Win API function.
@molsonkiko said:
...I'm going to keep looking into it
If you don't mind, I'd like to try coming up with a fix for this issue.
But, if you really want to yourself, let me know and I'll cease, as you expressed interest in this issue first.
from notepad-plus-plus.
If you don't mind, I'd like to try coming up with a fix for this issue.
@alankilborn
Go for it!
If I thought it was worthwhile, I could implement glob syntax similar to NavigateTo, which would add cool toys like squarebrace character sets and {x,y,z}
unions, but I feel like Notepad++ has too much history to make a breaking change like that worthwhile.
from notepad-plus-plus.
Side note: The user manual even mentions ::PathMatchSpec
!
from notepad-plus-plus.
I'm not surprised you're having this issue: files with an empty extension shouldn't exist, and most applications won't even create them.
TLDR: if files with that name shouldn't exist, you should consider fixing whatever is creating them (or begging the creator to fix it), not asking Notepad++ to handle your corner case.
I tried making a file with an empty extension using all of the following:
- Creating one using the GUI in the Windows 10 File Explorer
- Saving one in Notepad++
- Creating one with Python.
In every one of those cases, what I got instead was a file with no extension, not a file with an empty extension.
from notepad-plus-plus.
files with an empty extension shouldn't exist
I think OP means "no extension".
In other words, I don't know what an "empty extension" would be, other than no extension.
You can create an extensionless file in Explorer, from the command line, and many other ways.
In Explorer and Cmd, you can either use the .
or not, e.g. echo x>test
or echo x>test.
... both yield the same result, a file with the exact name test
in the file system.
from notepad-plus-plus.
@alankilborn Yes, you are right. My mistake.
I work with a lot of FANUC CNCs which strip any file extensions from the gcode files placed on the machine. When retrieved for editing, they have no extension.
Being able to search though a bunch of no-extension files in multiple subdirectories would be a win for me.
from notepad-plus-plus.
So I think the answer here is RTFM (Read The Fine Manual) and this issue may now be closed.
from notepad-plus-plus.
I see what you're saying, but for 30+ years I've been able to do from a DOS/command prompt dir/s *. and list every file and directory with no extension. It seems counterintuitive to look for *. and not find *. when they exist.
from notepad-plus-plus.
違反直覺
agree ...
( The file exists ) but ( cannot be found ) is really counterintuitive ...
.
from notepad-plus-plus.
So after a bit of fooling around, I've figured out the following:
Suppose you have a file named new2
(no extension). Then:
*.*
matches*
matches**
matches (when in recursive mode)w*
does not match*2
matches
I tested this on Notepad++ 8.5.8, 8.6.4, and 8.5.1, and I'm pretty sure the behavior is consistent. I'd like confirmation from others though.
So in short, it appears that find in files usually works fine for files with no extension, but this is one corner case where it's broken. Of course, this is still a bug, and I'm going to keep looking into it.
from notepad-plus-plus.
I'd like confirmation from others
I confirm I get the same results as you for your list.
from notepad-plus-plus.
Is a possible solution as "simple" as:
if a user's filter spec ends with .
, remove that character and let the search for matching files proceed; then examine results and if a matched filename has a .
in it, drop that file from consideration for the content-search phase
EDIT: I'll revise the above into:
if a user's filter spec ends with .
, remove that character and let the search for matching files proceed; then examine results and if a matched filename has no .
in it, consider it a match (think: implied .
at the very end of the name) and move it into the content-search phase of the overall search
from notepad-plus-plus.
Similar complaint from 2017:
from notepad-plus-plus.
In addition to extensionless files that should be matched with *.
, directory exclusion of this nature !\*.
and !+\*.
should exclude extensionless directories (currently it does NOT exclude them).
from notepad-plus-plus.
Just a note :
In CMD, because it was compared to existing Notepad++ filter capability earlier #14617 (comment) :
- a
dir *.
will match files to do contain a.
(at the start) such as.gitignore
,.editorconfig
, etc., as well as other files/dirs that don't contain.
(i.e., extensionless files) dir .*
will match only files that start with a.
- it doesn't seem possible for
dir
to return only files that have no.
whatsoever (but maybe some better CMD guru than me knows how to make it do this??)
A possible future version of Notepad++ could match files that have no .
whatsoever, via this filterspec: *. !.*
from notepad-plus-plus.
So I came up with some new code for N++ that will allow *.
to work.
However, it is somewhat of a performance killer regarding time it takes to search.
Click to view search scenario and timing results details
Searched N++ 8.6.4 source code tree
Find what: \z
Search mode: Regular expression
Filters: *
Roughly 2050 files are hit.
Timing with N++ 8.6.4: ~5s
Timing with new code that supports *. : ~12s
I will continue to look at possibilities to both support *.
and retain similar performance to existing N++ code.
I think it might be possible with a lot of restructuring of how locating the fileset to search is done (which is probably a deal-breaker for such code being accepted into N++ -- too much risk).
from notepad-plus-plus.
Related Issues (20)
- How to disable / remove the annoying code line display jumping sideways to the right by one space when the code is longer than 1000 characters. HOT 3
- Win 10 - F11 - Full screen hangs to white window.
- [BUG] shortcut alt+ "i" in menu file: "load session" VS "save session"
- [Feature request] <title>About search help. HOT 8
- [BUG] “Batch coding” color codes in 'Command' and 'Keywords' sections are not working. HOT 5
- REQUEST: Add the date to each update on the website HOT 1
- + sign for notepad++ HOT 4
- [BUG] <SQL comment in Language> HOT 2
- [BUG] Using a tab character when renaming an unsaved tab is problematic HOT 1
- [Feature request] Plugin capability to request renaming a file or tab
- [BUG] Macro recording incorrectly records steps HOT 1
- [Feature request] 💡Document List panel: Filter using incremental search box HOT 1
- [BUG] Autocomplete XML file directory unable to be written to without Admin privelages HOT 1
- [BUG] Search results containing non ASCII characters do not display the entire line HOT 1
- [BUG] Missing disabled fluent icon for monitoring
- Text Insertion Issue HOT 2
- [BUG] Begin/End Select Problem HOT 6
- Function List doesn't show functions with C++ Builder keywords
- [Feature request][Dark Mode] Custom draw for main toolbar
- JavaScript folding not working in PHP file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notepad-plus-plus.