【问题标题】:switch columns in Notepad++在记事本++中切换列
【发布时间】:2014-01-17 17:36:25
【问题描述】:

如何在 Notepad++ 中通过正则表达式切换列?例如我有这个数据集

user.Email|recipient.CreationDate|recipient.MessagePK|user.CustomAttribute.Correspondence_ID

但我希望它是:

user.Email|recipient.MessagePK|recipient.CreationDate|user.CustomAttribute.Correspondence_ID

也将数据行移动到列下方。

【问题讨论】:

    标签: regex notepad++ multiple-columns


    【解决方案1】:

    将第 1、2、3、4 列的顺序更改为 2、4、1、3:

    1. 单击 Ctrl/H。

    2. 选择正则表达式(弹出窗口的左下方)。

    3. 查找内容:(.*)\|(.*)\|(.*)\|(.*)

    4. 替换为:\2|\4|\1|\3

    【讨论】:

    • 我这样做了:(.user.Email)\|(.recipient.CreationDate)\|(.recipient.MessagePK)\|(.user.CustomAttribute.Correspondence_ID) \1\|\3 \|\2\|\4\ 但是列没有移动..
    • 表达式中有.。这是 Notepad++ 正则表达式中的一个特殊字符。请改用\.
    • 替换部分无需转义管道|
    猜你喜欢
    • 2017-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-10
    • 2021-11-25
    • 1970-01-01
    • 1970-01-01
    • 2013-08-20
    相关资源
    最近更新 更多