Notepad++ 添加到每一行 [英] Notepad++ add to every line
本文介绍了Notepad++ 添加到每一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 Notepad++,但我无法弄清楚这一点:
我有很多行都以 http
开头.我需要在每一行的前面添加一些文本.另外,我需要在每行的末尾添加不同的文本.每行的结尾都不同.
在每行的开头和结尾添加文本的最快方法是什么?
解决方案
请按以下步骤操作:
- 按 Ctrl+H 调出查找/替换对话框.
- 选择对话框底部附近的
Regular expression
选项.
要在每行的开头添加一个词,例如test
:
- 在
Find what
文本框中输入^
- 在
Replace with
文本框中输入test
- 将光标放在文件的第一行以确保所有行都受到影响
- 点击
全部替换
按钮
要在每行的末尾添加一个词,例如test
:
- 在
Find what
文本框中输入$
- 在
Replace with
文本框中输入test
- 将光标放在文件的第一行以确保所有行都受到影响
- 点击
全部替换
按钮
I'm using Notepad++ and I can't figure this out :
I have numerous lines all starting with http
. I need to add some text in front of it in every line. Also, I need to add different text to the end of each line. Each line ends differently.
What is the fastest way to add text to the start and end of each line?
解决方案
Follow these steps:
- Press Ctrl+H to bring up the Find/Replace Dialog.
- Choose the
Regular expression
option near the bottom of the dialog.
To add a word, such as test
, at the beginning of each line:
- Type
^
in theFind what
textbox- Type
test
in theReplace with
textbox- Place cursor in the first line of the file to ensure all lines are affected
- Click
Replace All
button
To add a word, such as test
, at the end of each line:
- Type
$
in theFind what
textbox- Type
test
in theReplace with
textbox- Place cursor in the first line of the file to ensure all lines are affected
- Click
Replace All
button
这篇关于Notepad++ 添加到每一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文