Notepad++

Notepad++ is free and open source primarily used for editing Text. My three favorite features are:

  1. the powerful find and replace
  2. support for macros
  3. column editing

Installation

Run the following in PowerShell to install Notepad++:

winget install -e --id Notepad++.Notepad++

The -e flag ensures an exact match on the application ID. This helps ensure that you're not installing a similarly named application by mistake.

Find and Replace

There are search modes:

  1. Normal. In the "Find what," every character is treated literally.
  2. Extended. This mode allows for special characters like \n (newline), \r (carriage return), and \t (tab) to be used in the search. These can be useful for deleting empty lines, or replacing tabs with spaces or commas.
  3. Regular Expression. This mode enables the use of regex patterns for more complex search criteria.

Example: Remove Empty Lines

Download empty.txt and open it in Notepad++. It contains a few empty lines. The file has instructions at the end for removing the extra lines using the extended search mode.

Example: Delete Lines to the Right of a Comma

Download commas.txt and open it in Notepad++. The file has instructions at the end for deleting everything to the right of each comma using the regular expression search mode.

Macros

The macro feature allows you to record a sequence of actions and then replay them. This is useful for repetitive tasks. Use it in conjunction with arrow keys, home, end, delete, backspace, etc. You can do complex formatting quickly. Replay the last recorded macro using the shortcut Ctrl+Shift+P. You can also replay a macro multiple times.

Download macros.txt and open it in Notepad++. The file has instructions at the end for using macros to delete the last 3 words in each line.

Column Editing

Column editing allows you to edit text in a columnar fashion, which is useful for making changes to multiple lines at once. This can be useful for formatting code in Markdown, CSV, or other structured text files. It can also be used to edit code, such as changing the name of a variable across multiple lines.

Download columns.txt and open it in Notepad++. The file has instructions at the end for using column editing to add a pipe character | throughout lines of text.