notepad ++行组合

问题描述

我们有此订单

129
12
2020
5424180606943758

我们需要这样

5424180606943758|12|2020|129

如何在记事本++或onoter应用程序中执行此操作

解决方法

  • Ctrl + H
  • 查找内容:(\d+)\R(\d+)\R(\d+)\R(\d+)\R?
  • 替换为:$4|$3|$2|$1
  • 检查 环绕
  • 检查 正则表达式
  • 全部替换

说明:

(\d+)           # group 1,1 or more digits
\R              # any kind of linebreak
(\d+)           # group 2,1 or more digits
\R              # any kind of linebreak
(\d+)           # group 3,1 or more digits
\R              # any kind of linebreak
(\d+)           # group 4,1 or more digits
\R              # any kind of linebreak,optional

替换:

$4          # content of group 4
|           # a pipe
$3          # content of group 3
|           # a pipe
$2          # content of group 2
|           # a pipe
$1          # content of group 1

屏幕截图(之前):

enter image description here

屏幕截图(之后):

enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...