50

When I paste this into Notepad on Windows 10:

"first_name"=>"M", "surname"=>"C", "country"=>"Australia"

and then try to find the string "name" with Ctrl+F, it comes up blank:

Notepad find

Is Notepad's Find function completely useless or am I missing something?

MSC
  • 577
  • 1
  • 5
  • 13

5 Answers5

139

The Find function starts where you placed your cursor. Since you pasted into Notepad, the cursor is likely at the end of the document.

You can either

  1. move the cursor to the beginning of the document
  2. switch the Find direction from Down to Up
Worthwelle
  • 4,816
59

Notepad doesn't support wrap-around search. If you select search direction as Down then it only searches from the cursor onward. Similarly Up will only search backward. The workaround is already mentioned in Worthwelle's answer

However since build 17666 Notepad will be able to do wrap-around search and you don't need to mess with that Up/Down options. That'll likely enter the main branch on Windows 10 version 1809

Wrap-around find/replace: We’ve made significant improvement to the find/replace experience in Notepad. We added the option to do wrap-around find/replace to the find dialog and Notepad will now remember previously entered values and the state of checkboxes and automatically populate them the next time you open the find dialog. Additionally, when you have text selected and open the find dialog we will automatically populate the search field with the selected text.

Announcing Windows 10 Insider Preview Build 17713

Notepad wrap around search

phuclv
  • 30,396
  • 15
  • 136
  • 260
5

Notepad's "find" feature searches either forward or backwards using the cursor's current position as a reference point.

You can see the radio buttons "Up" and "Down" for search direction. "Down" searches for the next match after the cursor, and "Up" searches for the previous match before the cursor. As you search, it moves the cursor around so that it doesn't find the same text over and over again.

The search doesn't wrap around when you hit the end of a document (unlike many other text editing programs).

You can either move the cursor to the beginning of the document, or you can change the radio button to "Up" to search in reverse.

2

As many have pointed out the reason is cursor is at the end, and it does not support wrap around. What has not been mentioned yet rather than trying both up and down direction searches (Say you were in middle, you would need to try both) you can simply Ctrl+A then Ctrl+F, since all are highlighted it will search everything.

phuclv
  • 30,396
  • 15
  • 136
  • 260
Lain
  • 121
-1

Is Notepad's "Find" function completely useless or am I missing something?

Notepad is basically useless. I only use it when I am writing short batch files (because cmd.exe doesn't like UNIX line endings) or need a very quick scratch pad to jot some brief notes that I don't mind losing in the event of a power outage. Notepad is very light on system resources and has the fastest startup time of any Windows text editor I've ever used but that's probably because it is near useless. WordPad, which also comes with Windows, is even more useless as a text editor for a variety of reasons - unless you need to create RTF files for some odd purpose.

When you need to find text in a text file on Windows, I recommend installing and using a real text editor. I still use Crimson Editor (the 2004 version, not the mostly broken Emerald Editor version). It's a really good editor as long as you don't need non-ASCII character encodings - it'll do UTF-8 but only if you coax it - and, IMO, beats Notepad++ on all the core areas of text editing that matter even though it is pretty old software at this point. Crimson also handles loading 200MB+ log files pretty well - most editors choke after 30-50MB. UltraEdit and Vim are the only other two text editors out there that can handle extremely large text files (not that you asked). I can't stand Notepad++, VS Code, and most text editors but Crimson's not for everyone either. Notepad++ Portable can be used on (most) machines that don't allow installing software on them.

My recommendation is to try a few different text editors to find one you like - just search for "alternative to [name of text editor]" on Google to start finding hundreds of options. Quite a few are free and pretty much any text editor is vastly superior to Notepad except for the few that come with obvious malware.

If you need to find specific text across multiple files on Windows, I recommend the findstr command from a Command Prompt:

cd path\to\files
findstr /sic:"what you want to find" *

It's WAY faster than any other method of finding things via Windows Explorer.