问题
I am having a file in which there are number of lines which i have to remove. These lines can be distinguished using regular expression and thus utilizing series of search and replace i am able to remove them.
Now i have to repeat the same task a number of times. So i am looking for a way that i don't need to go through this series of replace again & again. Is there any way to batch/script these series of replace into a single command.
I tried doing so by recording a macro, but does not seems to work.
回答1:
Try the Python Script plug-in, if you're familiar with Python. If you're not familiar with Python, you will be it in no time. Doing such kinds of automation is a fingersnip with that plug-in. And if you can't get something to work, you'll find help at the support forum of that plug-in.
At least one example link about regex replacement via the plug-in.
Besides I'm using replacement macros in N++ myself. Did you try with the complex singletabbed "Find/Replace" dialog or with the simple "Replace" tab of the multitabbed find dialog, which also supports regex? The latter one works for me. I didn't try the 1st one tho.
来源:https://stackoverflow.com/questions/10036705/how-to-automate-a-series-of-search-and-replace-operation-in-notepad