how to automate a series of search and replace operation in Notepad++

喜欢而已 提交于 2019-12-21 05:14:04

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!