Notepad++ 添加到每一行 [英] Notepad++ add to every line

查看:74
本文介绍了Notepad++ 添加到每一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Notepad++,但我无法弄清楚这一点:

我有很多行都以 http 开头.我需要在每一行的前面添加一些文本.另外,我需要在每行的末尾添加不同的文本.每行的结尾都不同.

在每行的开头和结尾添加文本的最快方法是什么?

解决方案

请按以下步骤操作:

  1. Ctrl+H 调出查找/替换对话框.
  2. 选择对话框底部附近的 Regular expression 选项.

要在每行的开头添加一个词,例如test:

<块引用>

  1. Find what文本框中输入^
  2. Replace with文本框中输入test
  3. 将光标放在文件的第一行以确保所有行都受到影响
  4. 点击全部替换按钮

要在每行的末尾添加一个词,例如test:

<块引用>

  1. Find what文本框中输入$
  2. Replace with文本框中输入test
  3. 将光标放在文件的第一行以确保所有行都受到影响
  4. 点击全部替换按钮

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:

  1. Press Ctrl+H to bring up the Find/Replace Dialog.
  2. Choose the Regular expression option near the bottom of the dialog.

To add a word, such as test, at the beginning of each line:

  1. Type ^ in the Find what textbox
  2. Type test in the Replace with textbox
  3. Place cursor in the first line of the file to ensure all lines are affected
  4. Click Replace All button

To add a word, such as test, at the end of each line:

  1. Type $ in the Find what textbox
  2. Type test in the Replace with textbox
  3. Place cursor in the first line of the file to ensure all lines are affected
  4. Click Replace All button

这篇关于Notepad++ 添加到每一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆