【问题标题】:Notepad++ Copy one character between linesNotepad++ 行间复制一个字符
【发布时间】:2021-04-30 21:54:57
【问题描述】:

希望你能帮我解决这个问题...

我有这个数据文件

The correct answer is A. and the reason for that answer is ....
ANSWER: 
The correct answer is B. and the reason for that answer is ....
ANSWER: 
The correct answer is C. and the reason for that answer is ....
ANSWER: 
The correct answer is D. and the reason for that answer is ....
ANSWER: 

我需要以某种方式将字母 A 或 B .. 等复制到答案:行

The correct answer is A
ANSWER: A
The correct answer is B
ANSWER: B
The correct answer is C
ANSWER: C
The correct answer is D
ANSWER: D

这可以吗?只抓住没有点的字母。? 谢谢

编辑:添加缺失的信息。对此感到抱歉

【问题讨论】:

  • 你要不要保留and the reason for that answer is ...

标签: regex notepad++


【解决方案1】:

使用正则表达式

查找:

is (.)(.*)\r\nANSWER:

替换

is \1\2\r\nANSWER: \1

【讨论】:

  • 感谢您的修复,它完成了部分工作,但是我没有显示完整的问题是我的错。第一行没有在字母 A 或 B 等之后结束,它继续解释为什么我们选择这个答案,比如正确答案是 A.,原因是.....
  • 完整的问题是什么?更新您的问题
  • 酷,编辑你的问题并举个例子
  • 已编辑 .. 我喜欢你的修复,希望可以调整它以仅提取字母。
猜你喜欢
  • 1970-01-01
  • 2016-01-03
  • 2021-01-28
  • 2014-03-05
  • 2018-03-31
  • 2018-08-05
  • 1970-01-01
  • 2019-03-17
  • 1970-01-01
相关资源
最近更新 更多