This post explains shows How to add text at the beginning and end of a file opened in Notepad++. Use the Find and replace feature using regular expression. the third way. For example, File content with the following content.

This is test content
This is test content4
This is test content5
This is test content
This is test content
This is test content

You want to add some text to begin and end of each line.

Notepad++ provides find and replace features to edit files.

How to add text to every line in Notepad++

use regular expression with the find and replace feature in notepad++.

Following are steps

  • Go to search menu > select Replace Menu item, or use shortcut (Ctrl + H)

  • It opens the Find and Replaces window

  • Steps to add the beginning of every line

  • Please do the following things to add text to the start of every line

    • Find what: ^

    • Replace With: === adds to the beginning of every line.

    • Search Mode: Check the Regular Expression radio button

    • Click on the Replace All button, It adds to the text file, can be saved

    • Following is the output

      ```markup
      { This is test content
      { This is test content4
      { This is test content5
      { This is test content
      { This is test content
      { This is test content
      ```
      
  • Please do the following steps to add text to the end of every line

    • Find what: ^

    • Replace With} adds to the end of every line.

    • Search Mode: Check the Regular Expression radio button

    • Click on the Replace All button, It adds to the text file, can be saved

    • Following is the output

      ```markup
          This is test content }
          This is test content4 }
          This is test content5 }
          This is test content }
          This is test content }
          This is test content }
      ```