如何在每一行后插入两行文字?

如何在每一行后插入两行文字?
63888501
36346246
36026700
53846004
57910034
45585184
11389311
47389379
63389410
23392487

输出应该是:

63888501 
taskkill /f /im ffs.exe 
notepad.exe one.txt
36346246
taskkill /f /im ffs.exe
notepad.exe one.txt
36026700
taskkill /f /im ffs.exe
notepad.exe one.txt
53846004
taskkill /f /im ffs.exe
notepad.exe one.txt
57910034
taskkill /f /im ffs.exe
notepad.exe one.txt
45585184
taskkill /f /im ffs.exe
notepad.exe one.txt
11389311
taskkill /f /im ffs.exe
notepad.exe one.txt
47389379
taskkill /f /im ffs.exe
notepad.exe one.txt
63389410
taskkill /f /im ffs.exe
notepad.exe one.txt
23392487
taskkill /f /im ffs.exe
notepad.exe one.txt

答案1

  • Ctrl+H
  • 找什么:$
  • 用。。。来代替:\ntaskkill /f /im ffs.exe \nnotepad.exe one.txt
  • 检查环绕
  • 检查正则表达式
  • Replace all

解释:

$       # end of line

替代品:

\n                          # linefeed, you can use \r\n for windows files
taskkill /f /im ffs.exe     # literally
\n                          # linefeed, you can use \r\n for windows files
notepad.exe one.txt         # literally

给定示例的结果:

63888501
taskkill /f /im ffs.exe 
notepad.exe one.txt
36346246
taskkill /f /im ffs.exe 
notepad.exe one.txt
36026700
taskkill /f /im ffs.exe 
notepad.exe one.txt
53846004
taskkill /f /im ffs.exe 
notepad.exe one.txt
57910034
taskkill /f /im ffs.exe 
notepad.exe one.txt
45585184
taskkill /f /im ffs.exe 
notepad.exe one.txt
11389311
taskkill /f /im ffs.exe 
notepad.exe one.txt
47389379
taskkill /f /im ffs.exe 
notepad.exe one.txt
63389410
taskkill /f /im ffs.exe 
notepad.exe one.txt
23392487
taskkill /f /im ffs.exe 
notepad.exe one.txt

答案2

快速而肮脏的方法是使用宏

  1. 把你的放到taskkill /f /im ffs.exe notepad.exe one.txt剪贴板上。
  2. 转到文档第一行的末尾并点击录制
  3. 按回车/回车键,然后按 ctrl+v
  4. 光标向下移动到下一个数值的末尾
  5. 停止录制
  6. 现在单击播放至文件末尾

答案3

使用扩展的替换功能进行搜索和替换,\r\n并将其替换为\r\n<your text>

\r\n表示 Windows 换行符(回车符和换行符)。如果您使用其他行尾,则可能只需要查找\n

相关内容