【问题标题】:How to replace column of values with another column of values in notepad++如何用记事本++中的另一列值替换一列值
【发布时间】:2016-09-28 23:35:04
【问题描述】:

如何用记事本++中的另一列值替换一列值 例如,假设我的文件 1 内容如下

name2.address2.age.location
name3.address5.age.location
name1.address1.age.location
name4.address4.age.location

我想用另一个文件中的新值替换地址列

A123
234
5678
adafsffsafasfa

让我替换的内容看起来像这样

name2.A123.age.location
name3.234.age.location
name1.5678.age.location
name4.adafsffsafasfa.age.location

我尝试了 Alt+c 和 alt+shift 的组合,但没有帮助。 谢谢你的时间。

【问题讨论】:

  • 也许写一个使用regex的小程序来做同样的事情?
  • Cinout,我想到的正则表达式将适用于单个值。 Ton Plooij,该解决方案是将单个值粘贴到单个列中。虽然我想用多个值替换单列。
  • 为什么不向我们展示您的尝试,以便改进?
  • CinCout,我尝试了 linux 方式 "awk -F. 'NR==FNR{a[NR]=$0;next}{$2=a[FNR]}1' "... 但是我想要windows解决方案。在记事本++中,我使用“Alt+Shift+Down”键选择了couln,并使用“Alt+C”组合将其替换为ABC。

标签: replace notepad++ paste


【解决方案1】:

我在玩,不小心发现了我的问题的解决方案。 要替换列,请按照以下步骤操作:

1. Select the column using "`Shift + Alt + Down`" key combination 
2. Then delete the column by pressing the "`Delete`" key.
3. Select "new" column using "`Shift + Alt + Down`" key combination
4. Do the `drag` while holding down the `Alt` key. 

为了更清晰,附上动画。 Alt drag 也可以用来移动列位置

【讨论】:

    猜你喜欢
    • 2021-04-24
    • 1970-01-01
    • 1970-01-01
    • 2018-11-04
    • 1970-01-01
    • 1970-01-01
    • 2018-08-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多