#0419 – 2 things I didn’t know about Notepad


Today’s post is a quick one based on an experience I had recently. In one hour, I learnt two (2) new things that I didn’t know about Windows Notepad.

I was in an Azure training recently and working my way through a lab exercise. As I was building my environment, I had collected a bunch of tokens and connection strings in a Notepad file. And that’s when I ran into the first thing I didn’t know about Notepad.

The maximum length of text allowed in a line is 1024 characters

The following is a simulated text that I generated by replicating the English alphabet and the numbers (0-9) such that the resulting string is 1044 characters in length. In Notepad, the string automatically wraps at 1024 characters.

The workaround was simply to open the file in the Visual Studio IDE (which does not have the same limitations).

Image showing automatic wrapping of strings to 1024 characters in Notepad
Image showing automatic wrapping of strings to 1024 characters in Notepad

Text searches only work for first 128 characters

Immediately after I realized the word wrap limit, I was trying to search a connecting string (which was 133 characters in length) and landed up with multiple hits (which I was not supposed to).

After triple-checking everything, looked at what was being searched and that’s when I realized that the search box only takes 128 characters.

Screengrab showing that the text in the Notepad search box in Notepad stops at 128 characters
Screengrab showing that the text in the Notepad search box stopped at 128 characters (green lines)

If you want to see it for yourself

You can use copies of the following string (37 characters in length) and an instance of Notepad:

abcdefghijklmnopqrstuvwzyz0123456789

Until we meet next time,

Be courteous. Drive Responsibly.

Advertisement

Let me know what you think about this post by leaving your feedback here!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.