![](/img/trans.png)
[英]Notepad++ split numeric values separated with semi-colons and commas keeping the lines having single pairs intact
[英]Swap text between commas and among the colons
我有一个包含重复代码的文件,我只想这样
交换卷/列? (怎么说)y和z的每个数字都不相同
例:
xxxx,xxxx,yyyy,xxxx,xxxx,zzzz:xxxx:xxxx:xxxx:xxxx:
xxxx,xxxx,yyyy,xxxx,xxxx,zzzz:xxxx:xxxx:xxxx:xxxx:
xxxx,xxxx,yyyy,xxxx,xxxx,zzzz:xxxx:xxxx:xxxx:xxxx:
xxxx,xxxx,yyyy,xxxx,xxxx,zzzz:xxxx:xxxx:xxxx:xxxx:
成:
xxxx,xxxx,zzzz,xxxx,xxxx,yyyy:xxxx:xxxx:xxxx:xxxx:
xxxx,xxxx,zzzz,xxxx,xxxx,yyyy:xxxx:xxxx:xxxx:xxxx:
xxxx,xxxx,zzzz,xxxx,xxxx,yyyy:xxxx:xxxx:xxxx:xxxx:
xxxx,xxxx,zzzz,xxxx,xxxx,yyyy:xxxx:xxxx:xxxx:xxxx:
x,y,z =不同的数字
抱歉,解释不佳
例
36,192,72004,128,0,71923:0:0:0:0:
256,192,72014,128,0,71843:0:0:0:0:
475,192,72204,128,0,71923:0:0:0:0:
至
36,192,71923,128,0,72004:0:0:0:0:
256,192,71843,128,0,72014:0:0:0:0:
475,192,71923,128,0,72204:0:0:0:0:
他应该做的工作(在Notepad ++中):
^((?:[^,]+,){2})(\\d+),((?:[^,]+,){2})(\\d+)
$1$4,$3$2
说明:
^ : start of line
( : start group 1
(?: : start non capture group
[^,]+ : 1 or more non comma
, : a comma
){2} : end group, must appear twice
) : end group 1
(\d+) : group 2, 1 or more digits
, : a comma
( : start group 3
(?: : start non capture group
[^,]+ : 1 or more non comma
, : a comma
){2} : end group, must appear twice
) : end group 3
(\d+) : group 4, 1 or more digits
替代:
$1$4,$3$2 : group 1 group 4 comma group 3 group 4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.