I'm not sure it's possible or not, but one of the things I find I need to do often is to replace the contents of the file, but I want to use the current line number as a replacement option. So if I had a file like:
This is text to replace XX
This is text to replace XX
This is text to replace XX
I would want to be able to run a regex that would turn that file into:
This is text to replace 1
This is text to replace 2
This is text to replace 3
I've looked around, but I can't seem to find any way of doing this. Is this possible? Does anyone know of a simple way to approach this?
Thanks.