在逗号和冒号之间交换文本

Swap text between commas and among the colons

我有一个文件包含这样的重复代码,我只想

换一个roll/column? (怎么说?) 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++ 中):

  • Ctrl+H
  • 查找内容:^((?:[^,]+,){2})(\d+),((?:[^,]+,){2})(\d+)
  • 替换为:,
  • 全部替换

解释:

^           : 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

替换:

,   : group 1 group 4  comma group 3 group 4