Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ add to every line

Tags:

notepad++

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?

like image 880
johnkol Avatar asked Jun 12 '12 19:06

johnkol


People also ask

How do you select all lines in notepad?

Go to the line from where you want to select all the lines below, you can try using Ctrl+G and adding the line number if you know it, Press Home to get to the start of the line, Now press Shift + End, Keep holding Shift and press Page Down to select all lines below.


1 Answers

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
like image 108
Jay Sullivan Avatar answered Sep 20 '22 00:09

Jay Sullivan