This post explains How to add text at the beginning and end of a file opened in Notepad++. Use the Find and replace feature using regular expressions. 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 the beginning 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 the 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 and can be saved
    • Following is the output
        { 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 and can be saved
    • Following is the output
            This is test content }
            This is test content4 }
            This is test content5 }
            This is test content }
            This is test content }
            This is test content }