Thursday, September 29, 2011

Notepad: save non-TXT files without .txt ending e.g. html files

I still often use Notepad in Windows for quickly producing simple html or js files and the like.
One pain is that when you "Save" or "Save as" a file in Notepad, the program automatically sticks a "txt" at the end of the filename so you end up with a file called something like "myfile.html.txt" - which really doesn't work properly as an html file (or whatever) until you rename it to get rid of the ".txt". Or you have to change the "Save as type" box, which is an extra step.
Here's a tip which I only recently discovered, I don't recall where from, which saves you all that hassle - read on for how to save non-text files quickly without a .txt being appended to the end of the file name.
When you choose Save or Save as, in the File Name box just type the name of your file with .html or .htm (or whatever extension you need) as the ending, but surround the filename with doublequotes. NOT single quotes, it has to be double quotes (Shift 2 usually). Like this, where I've used "myfile.html" as the filename:

Then choose your file location and Save it, and you'll find that even though you didn't touch the "Save as type" box, it's been saved with exactly the right file extension - no annoying extra "txt" at the end. I love tricks like these!

No comments:

Post a Comment