A couple of weeks ago I covered a great find/replace feature that most users aren’t aware is in Notepad++, and today we want to go through my favorite TextFX features that you’ve probably got installed but haven’t played around with. When going through the setup process Notepad++ by default will install some plugins, one of which is labeled as NPPTextFX. With this installed you’ll see the TextFX menu pictured in the screenshot above.
Hovering through the menu options can be quite overwhelming since there are over 150 entries sorted throughout the ten different categories. Here are some of the options I use the most:
Note: When trying out most of these options you’ll need to highlight the text you want it to apply to. If you don’t have any text highlighted many of these features won’t actually do anything.
- TextFX Characters -> UPPER CASE, lower case, Proper Case, Sentence case, iNVERT cASE: Each of these let you change the case that the selected text is presented in. It’s a quick way to make those all-caps emails a little less agitating.
- TextFX Edit -> Delete Blank Lines: As the name implies this will delete all empty lines from the text file, which is something I tend to encounter on a regular basis when processing data from log files.
- TextFX Edit -> Delete Surplus Blank Lines: Removes blank lines when there are two or more consecutive empty lines. Those two or more blank lines will be condensed down to just one blank line.
- TextFX Convert -> Encode URI Component: Encodes text to make it URL-friendly.
- TextFX Convert -> Encode HTML (&<>”): There are times I’m writing example code to put on a site that needs all HTML characters encoded so that they aren’t inadvertently converted into actual HTML on the page. This is perfect for a job like that
- TextFX HTML Tidy -> Tidy Reindent XML: Takes unformatted XML text and indents it to make it more readable.
- TextFX Tools -> Sort lines case sensitive, Sort lines case insensitive: Sorts lines of text with or without case sensitivity. I look at this as a much simpler form of the column sorting found in Excel.
- TextFX Tools -> Insert Line Numbers: Adds line numbers to all the lines you have selected, but unfortunately you can’t control the number of zeros that each one is padded with.
- TextFX Tools -> Delete Line Numbers or First Word: Remove a line number or anything that leads up to the first whitespace character on each line.
- TextFX Tools -> Word Count: Gives you all kinds of details including word count, number of characters, number of lines, longest line, and more.
As you can see there are a lot of useful text modifications you can make using TextFX in Notepad++ as long as you didn’t disable the plugin during the setup process. I highly recommend spending a few minutes and going through the menus to see what they all have to offer… who knows, you may be surprised to see items that will automate repetitive processes you are regularly going through.