for example i have about 500 lines. in the beginning of each line i want to add a number. so in line 1 i would want \"1)\" and then line 2 i would want \"2)\"
i know
Notepad++ Macros only playback keyboard actions. They can't do anything dynamic.
However there is a built-in(?) plugin that can do this for you.
Highlight all the code, then choose "TextFX / TextFX Tools / Insert Line Numbers"
One thing to be aware of is that it is the absolute line number within the file. You can't start numbering on line 10 and make it say line 03 or something like that.
TextFX->TextFX Tools->Insert Line Numbers
I have a suggestion but isn't fully automated.. You can open a new file Press the macro recording button:
As answered in question https://superuser.com/questions/331098/flip-or-reverse-line-order-in-notepad do:
I hope it helps, I didn't try it but I can't see how it couldn't work.. :-)
You could use TextPad if you need a versatile solution to this problem. Just open the replace dialog in it; set replace mode to regex and then in replace by textbox use \i where you want an incrementing sequence to be used.
Edit -> Column Editor and use the bottom option on that dialogue (Number to Insert). This way you can also start from whatever number you like and not have to have the leading zeros.
In the more general cases where you want to add a sequence number more selectively (e.g. in the middle of a line, or only for some lines), there are two methods:
Hold down alt and use your mouse to drag a rectangular region, as described in http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Column_Editing Then use Edit -> Column Editor -> Number to Insert as per Tom's answer.
Select a rectangular region again as above, copy the single character # to your clipboard, then use TextFX -> TextFX Edit -> Insert (Clipboard) through lines, as described here: http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Clipboard_Uses#Insert_through_lines_variable_text