Windows 10 Notepad can't find text

43

6

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

Posted 2018-09-18T23:12:43.483

Reputation: 577

1I advise Wordpad instead. Not sure if it's part of Base Windows though. – Malady – 2018-09-19T10:21:32.793

4@Malandy +1 to Wordpad for being better than Notepad. If by "base Windows" you mean it is installed automatically, then yes, it comes with base Windows. – MindS1 – 2018-09-19T13:14:52.740

@MindS1 - Yeah, that's what I meant. What would you recommend instead? – Malady – 2018-09-19T13:16:17.127

25@Malandy as far as built-in Windows utilities go, Wordpad is the best you can get. The best alternatives are Notepad++ for general use, Sublime Text if you're a programmer, or VIM if you're a baller power user. – MindS1 – 2018-09-19T13:19:12.040

3I think if you open up a file that has null characters between each byte of ASCII (e.g. T\x00E\x00X\x00T\x00, which might happen if a UTF-16 file isn't detected as such), it can also cause strange things to happen, where you'll just see TEXT as the nulls get hidden, but never find TEXT in it. That behavior may have changed in newer Windows versions though. – Nick T – 2018-09-19T16:00:37.243

.reg files on at least some windows versions are notorious for that - they are UTF16 and confuse many editors.... – rackandboneman – 2018-09-19T19:31:08.273

5The real answer is to use Notepad++ instead. – Pikamander2 – 2018-09-20T08:38:43.173

I always get surprised that when people are not using Notepad++. Sure, 1995 was a good time but it has passed. – Farhan – 2018-09-21T12:27:52.830

1I do not consider Notepad to be completely useless. There are many many regular users who are not developers. They do not need all fancy features of notepad++ or don't care about those. They may use Notepad to jot down few notes here and there. I understand that Notepad is severely crippled for any serious developmental work, but it is not completely throw-away either. – Cricrazy – 2018-09-21T13:50:12.010

2@Pikamander2 The real real answer is to use Vim instead. ;) – Sparhawk – 2018-09-22T07:52:06.863

1

@MindS1 in all seriousness I recommend using gVim on Windows until the DOS prompt colours and Vim work together fully. Also gVim is much more tolerant for Windows users. The Windows team have made massive steps in the DOS prompt in Windows 10 to make it capable of fully supporting things like Vim. Also it's worth noting that anyone who's installed Git will have Vim included in the user binaries that come with it. Having syntax highlighting inside Vim on the DOS prompt is really quite trippy.

– icc97 – 2018-09-23T12:35:49.593

For goodness sake, Notepad itself is useless. Please use a modern text editor instead of purposely shooting yourself in the face. – Spencer Williams – 2018-09-25T15:57:20.777

Answers

134

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

Posted 2018-09-18T23:12:43.483

Reputation: 3 556

40Hint: To move the caret to the start of the file, press Ctrl+Home. (Also, a bit of nitpicking: in Windows, you typically use "cursor" for the mouse pointer thing and "caret" for the text input thing.) – Andreas Rejbrand – 2018-09-19T06:42:40.447

22@AndreasRejbrand only you use that probably, I've never heard anyone actually say caret... or maybe we're both showing our age! – LocustHorde – 2018-09-19T07:59:40.187

27Caret is correct, but it's a bit like talking about Kibibytes. It causes more confusion than benefit in most cases. – allo – 2018-09-19T10:31:35.110

7@AndreasRejbrand Microsoft use the terms cursor and pointer for text cursor and mouse cursor, respectively. "Caret" is only used to describe the text cursor in Windows when talking about "caret browsing" (a term introduced by Firefox). Otherwise it's the ^ symbol/diacritic. – Aaron F – 2018-09-19T15:38:54.853

11Text cursor is referenced almost exclusively as "caret" in Windows API documentation. The SetCursorPos function moves the mouse pointer (cursor) to given (screen) position. The SetCaretPos places the text cursor at given position relative to window's client area. – Daniel Sęk – 2018-09-19T16:52:20.053

6Microsoft obviously regularly participates and wins in contests where the most counter-intuitive UI behaviours are awarded. – rexkogitans – 2018-09-19T20:34:32.427

How about "Keyboard cursor"? – NH. – 2018-09-20T18:16:05.807

2Just say 'caret'. Why contribute further to the dumbing-down of society? If somebody doesn't know what it is, then they will learn something. Great! – codah – 2018-09-20T22:31:49.440

Click to relocate is the "scalpel" solution. Closing and re-opening the file is the "axe". Windows keyboards have a home key as well. Why is the flashing cursor not obvious? It needs to be a block or thick underscore ala VT100/220. – mckenzm – 2018-09-20T22:49:38.590

Oh wait, you guys are talking about the insertion point. – Mr Lister – 2018-09-21T08:07:31.680

4

@codah because caret is not the correct word. It's similar - https://en.oxforddictionaries.com/definition/caret is a mark to indicate a proposed insertion in a text - but not the same. There you go, you've learnt something. Great!

– Aaron F – 2018-09-21T09:19:29.973

Wow. I really touched a nerve with this question :) – MSC – 2018-09-22T11:15:06.403

@allo Especially since we usually mean the caret-character ^ when talking about carets. – Mast – 2018-09-23T10:09:02.450

57

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

Posted 2018-09-18T23:12:43.483

Reputation: 14 930

17:o they're making notepad useful? What next - hex editor? regex? Why not just toss it out and put VSCode in instead.. :) – Caius Jard – 2018-09-19T10:55:58.963

2@CaiusJard: Same reason why ed, not emacs, is the standard Unix text editor. >_> – user1686 – 2018-09-19T11:03:15.647

4@CaiusJard why would anyone who doesn't do coding need VS code? At least MS made Notepad understand *nix line endings for WSL to work, and while taking the chance to fix that why don't just do other improvements as well? – phuclv – 2018-09-19T14:38:16.033

3@CaiusJard they used to have a sort-of hex editor, good ol' MS-DOS debug (think it might still exist in 32-bit Windows) :-) – Aaron F – 2018-09-19T15:55:35.577

3@phuclv it was a bit of a tongue-in-cheek comment from me initially, but the essence of it was; they have at least one really smart, powerful text editor, and after about 20 years of dev notepad is getting the most basic of features to improve its usability - if they carry on in this way, in about 150 years or so, notepad will be vscode, so why not just drop notepad and use some (hollowed out, if you insist) vscode right now.. – Caius Jard – 2018-09-19T16:46:07.597

8A notepad instance uses 2 MB of RAM and starts instantly. VS Code... doesn't. – josh3736 – 2018-09-19T21:32:43.500

1I can imagine the excitement of the developer who was tasked with adding these amazing features to Notepad. – codah – 2018-09-20T22:37:50.510

@codah I don't know if "excitement" is the right word for adding features to a piece of software that's probably older than the developer themselves. – Justin – 2018-09-21T00:05:21.213

1@JustinLardinois turn on your sarcasm detector :) – codah – 2018-09-21T00:15:00.193

1@CaiusJard the reason it's not going to get all those features is because it's supposed to remain a bare bones text editor, it's not meant to be an IDE. – icc97 – 2018-09-23T12:10:20.733

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.

AberrantWolf

Posted 2018-09-18T23:12:43.483

Reputation: 161

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.

Lain

Posted 2018-09-18T23:12:43.483

Reputation: 121

4It's better to use Ctrl+Home since nothing will be selected and you won't accidentally delete the content by pressing some key – phuclv – 2018-09-21T01:29:44.477

-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.

Coolio Joe

Posted 2018-09-18T23:12:43.483

Reputation: 1

2I use notepad as a staging area to wash RTF formatting, it cures a lot of evils. In ancient times Help/About would report installed memory. It is still useful as a scratch pad when copying and pasting snippets of data that Notepad++ would need to be programmed to highlight. – mckenzm – 2018-09-20T22:55:35.807

6This doesn't really answer the question. – Blackwood – 2018-09-20T23:05:08.913

Just looked up Crimson Editor (never heard of it before) and see that the latest version was released in... 2008. I doubt that it even has 64-bit version, and no Unicode support is a big no-no, most people live in countries where ASCII is not enough, and even if you're speaking English you'll still need symbols like →μ►™✔... in Unicode. most editors choke after 30-50MB most advanced editors I've used can handle a log file of hundreds of MBs or even GBs without problem. Probably you haven't updated for decades. And findstr isn't as good as grep if you want to do advanced searching – phuclv – 2018-09-21T01:41:39.853

"find specific text across multiple files on Windows I recommend the findstr", I'd recommend installing ripgrep, you can get it from the ripgrep Chocolatey package, it's built using Rust and can be ridiculously fast at searching through massive code bases.

– icc97 – 2018-09-23T13:36:25.627