How can I increment numbers on every match in Notepad++ Python Script or Android Studio?
- With Notepad++, install Python Script plugin.
- Go to Plugins -> Python Script -> New Script.
- Enter the code below. Save it.
import re counter = 0 def calculate(match): global counter counter += 1 number = int(match.group(0)) + counter return str(number) editor.rereplace('(?<=textView)(5)', calculate)
- Open the file you want to edit.
- Go to Plugins -> Python Script -> Scripts, select the script you created and saved.