FIND is not returning any results
-
I have a file open in NotePad++ . I search for a word that is in the file but it says,
“Search “Location” (0 hits in 0 files of 1 searched)”
So the search results window is there, but no results. I have tries all 3 search modes. I’ve clicked find next, find all in current document, whole word, wrap around, etc. So I’ve tried all combinations and still no results.
Any ideas why?Thanks
-
@Robert-Harrison-0 said in FIND is not returning any results:
Any ideas why?
Because the text you are searching for does not exist in the file. Or you have done something else wrong. But since we didn’t see your actions, we cannot tell you for sure what you did wrong.
Maybe if you gave us an example sequence of events (be explicit about what menu commands or keyboard shortcuts you used – and if possible, include screenshot of the Find dialog)
I’ve clicked find next, find all in current document,
Those do two different things. Find Next will only move the highlight to the next instance in the document, and will not put any results in the Search Results window. Find All in Current Document will put any matches in the Search Results window, so if you really clicked that, then it means that your Find What didn’t match anything in the current document.
-
A big hint might be to uncheck Match whole word only if it is checkmarked.
Otherwise, as Peter has said, you’ve got to give some information to get some information.
-
I was going to add
vs
(with apologies to Weird Al. But really, if he cannot handle being parodied, who can?)
But then Alan-Kilborn said,
A big hint might be to uncheck Match whole word only if it is checkmarked.
Ah, yes, that is a highly-likely culprit.
-
You were right, the text did not exist. I found the reason but not the solution if one does exist.
The file is a .msg file from Outlook365. NotePad++ shows regular text, but NotePad shows some character (translated to a space in Notepad) between every letter seen in NotePad++. Is there an encoding or language setting that will help? I tried a few with no luck.
So in NotePad++ I see the text: Location
A find, finds nothing.
But in regular NotePad I see the text: L o c a t i o n
where there is space (code 32) between each letter. It must be somenthing other than a space in the original file because searing for “L o c a t i o n” also returns no results.Here is the debug info if that is needed:
Notepad++ v8.5.3 (64-bit)
Build time : May 15 2023 - 06:09:36
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : “C:\Users\bharrison\OneDrive - Lighthouse, Inc\Documents\Notification for a schedule.msg”
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit)
OS Version : 21H2
OS Build : 19044.3086
Current ANSI codepage : 1252
Plugins :
ComparePlugin (2.0.2)
ComparePlus (1.1)
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4)Thanks
-
@Robert-Harrison-0 said in FIND is not returning any results:
The file is a .msg file from Outlook365. NotePad++ shows regular text
A .msg file isn’t a regular text file. It will also contain meta-data which is used by the parent app (Outlook in this case) to show additional formatting, header information etc. These types of files are ONLY meant to be read/altered by the “parent” app, or other app that states it can open those types of files.
It’s interesting you say Notepad++ shows “regular text” yet Notepad shows spaces between characters. So I suggest reading one of the FAQ posts in regards these types of files here.
Terry
-
That makes perfect sense. I just didn’t know if NotePad++ could actually read .msg files, but now I know it doesn’t. The language, like SQL, is just for formatting the plain text document.
If I navigate to the file in File Explorer and select Edit in NotePad++ it looks like regular text. Of course a lot of it is the coding that doesn’t make sense to just read. But the actual message parts looks normal and is readable, but has those extra invisable characters.
If I open it from NotePad++ it looks like the file in the link you sent with all of the black highlighting.Thanks for making this clear to me.
-
@Robert-Harrison-0 said in FIND is not returning any results:
The file is a .msg file from Outlook365.
As @Terry-R said more briefly than I, an Outlook
.msg
file is not a text file; it is a binary file; the FAQ he linked you to explains why it only sometimes works.NotePad++ shows regular text,
Unless you have View > Show Symbol > Show control characters … turned off in Notepad++, Notepad++ shows
NUL
in a black box between every apparent character. (That option defaults to on to match the historical behavior of always showing control characters.)
but NotePad shows some character (translated to a space in Notepad) between every letter seen in NotePad++.
That’s the
NUL
(ASCII 0). Because the pieces of text stored in a.msg
file are by default UTF-16 LE encoded, then for “normal” ASCII characters, the UTF-16 LE enocoding will have the first byte (the LSB) the same as the ASCII byte, and the second byte (the MSB) will be 0x00 (interpreted as NUL) – so if they are interpreted as each byte is one character, then the tool will show a normal ASCII character followed by a NUL character. And since MS Notepad doesn’t have a clever black-box for NUL, it shows something that looks like a space instead.Is there an encoding or language setting that will help?
Since it’s a binary file, no encoding that you pick will be right.
The language, like SQL, is just for formatting the plain text document.
Wrong. The
.msg
format is for storing an email message, including any and all variants and attachments and embedded images and … it’s not a plain text document in any way, shape, or form. As the FAQ says, it’s a binary file that may or may not have some of the text that’s embedded in the file encoded in such a way that it uses the same bytes as the ASCII for the same character, with no guarantee that it will always; and in this particular case, if you saved the.msg
in the default way, it’s encoded as UTF-16 LE; there is an option to save the.msg
without unicode, so more bytes of your text will line up without the NUL bytes between, but there’s no guarantee that MS wouldn’t decide to compress the text in their.msg
format at some point (I’m surprised they don’t already).If I navigate to the file in File Explorer and select Edit in NotePad++ it looks like regular text.
No it doesn’t by default. You might have an option turned on to hide the other bytes, but that’s your own decision for changing the default behavior of Notepad++.
-
I understand everything you are saying. I just didn’t say it clearly in a couple of the things I commented on.
The language, like SQL, is just for formatting the plain text document.
Wrong.
What I meant is that the Language tab only effects what the plain text looks like and has nothing to do with the encoding. So if I have a SQL query it will be just black on white text. If I select SQL as the language it will color code it for comments, etc.
If I navigate to the file in File Explorer and select Edit in NotePad++ it looks like regular text.
No it doesn’t by default.
Here is a section of the file if I select EDIT IN NOTEPAD++
The same portion of the file when opened from within NotePad++ looks like this.
So it seems the default view is different between the two ways.
In either case the menu item looks like this.
And I can make the “edit” version look like the “open” version from this menu and visa versa.
Thanks for all of the feed back. I just started using NotePad++, so I am just learning what it can and can’t do. I’ve used the Compare Plus plugin which is GREAT!
-
@Robert-Harrison-0 said in FIND is not returning any results:
So it seems the default view is different between the two ways.
Not normally.
Show your ?-menu’s Debug Info when you open Notepad++ in both ways. My guess is that it’s either opening two different copies – and one of the copies has a corrupt configuration – or there is a command-line argument in one of the instances or something else really weird is going on. Because Notepad++ doesn’t differentiate between files opened from Explorer and files opened from inside.
-
Both Debug Info are identical as shown in a previous reply.
-
@Robert-Harrison-0 said in FIND is not returning any results:
Both Debug Info are identical as shown in a previous reply.
Then you have some magic going on that I cannot reproduce, because Notepad++ does not treat files opened via Explorer Context Menu and files opened via File > Open any differently.