记事本++如何从批量替换中乘以数字? [英] Notepad ++ How to multiply numbers from mass replace?

查看:56
本文介绍了记事本++如何从批量替换中乘以数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试乘以价值

"StackSize" Value="x"

到 3.

所以 x 中的所有值都会大三倍.如何使用批量替换来实现?

解决方案

你不能.Notepad++ 没有在其搜索/替换命令中进行算术运算的功能.像这样的任务可以通过编程或脚本语言来完成.例如,可以使用 Perl 替换 s/.../.../e

引自 http://perldoc.perl.org/perlop.html::><块引用>

A/e 将导致替换部分被视为成熟的 Perl 表达式并立即进行评估

Notepad++ 的插件为 Python 提供了良好的支持,可以让您实现您想要的.

I'm trying to multiply value in

"StackSize" Value="x"

By 3.

So all Values in x would be three times bigger. How can I do it by using mass replace?

解决方案

You cannot. Notepad++ does not have the facilities to do arithmetic in its search/replace commands. Tasks like this can be done with programming or scripting languages. For example the Perl substitution s/.../.../e could be used

Quoting from http://perldoc.perl.org/perlop.html:

A /e will cause the replacement portion to be treated as a full-fledged Perl expression and evaluated right then and there

Notepad++ has plugins that provide good support for Python and that may allow you to achieve what you want.

这篇关于记事本++如何从批量替换中乘以数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆