Macros have become one of my favorite features in Notepad++. It is possible to record actions and play them back one or more times. You can save a lot of time not having to manually repeat the same process over and over. I always have Notepad++ open, so it is fast and easy to get the result I want in just a few seconds.
In short, click on Start Recording, do whichever actions are needed, click on Stop Recording and Playback the macro one or more times. In this example I want to transform an ordered list of names into a comma-separated list I can use in a T-SQL IN operator. It would not take a lot of time to rewrite this particular list manually, but it takes a fraction of the time using macros, and the more data you work with the more time you save.
Keep in mind that the actions will be played back exactly as they are recorded, so use CTRL to work on words rather than characters. Use CTRL+arrows to move the caret to the previous or next word. Use CTRL+SHIFT+arrows to mark words if you need to copy them. Use CTRL+BACKSPACE or CTRL+DELETE to delete entire words at once instead of using BACKSPACE or DELETE multiple times. Use HOME and END to move the caret to the start or end of a line. It is also a good idea to disable Word Wrap if you’re working on multiple lines.
2. In this picture the following actions have been done and recorded:
– CTRL+DELETE deleted the number 1
– CTRL+DELETE deleted the dot and spaces
– Single quote added
– END moved the caret to the end of the line
– Single quote and comma added
– DELETE deleted the line break and moved the next line up to the end of the current line
Click Stop Recording (use either the button on the toolbar or through the menu Macro → Stop Recording).
4. Click Run a Macro Multiple Times (use either the button on the toolbar or through the menu Macro → Run a Macro Multiple Times) to replay the recorded macro as many times as you specify or until the end of file, as shown in this picture.