Add Text at Start and End of Each Line Notepad++

Notepad++ is a very useful text editor for every programmer, sadly its not yet available on the Mac OSX,

If you are in a situation where you want to put some text at the start of each line in your text, or at the end of each line , or both , well you can achieve this in notepad++ using the Find and Replace option using Regular Expression.

Check out how you can do it,

Step 1: Open Your text in Notepad++

Insert text at the beginning and end of each line notepad++

Step 2: To add Text at the Start of each line

    Press Ctrl+F to open Find window, click on the Replace tab, check that you have selected Regular Expression option, now add ^ in the Find textbox and the text you want at the start of each line in the Replace textbox, and click Replace all.

 

Find and Replace notpad++ to insert text at start

Step 3: To add Text at the End of each line

    Press Ctrl+F to open Find window, click on the Replace tab, check that you have selected Regular Expression option, now add $ in the Find textbox and the text you want at the End of each line in the Replace textbox, and click Replace all.

 

Find and Replace notpad++ to insert text at end

Step 4: Result

Result notepad++

 

    This trick is very useful when transforming a text into sql queries.

http://code2care.org/pages/add-text-start-end-each-line-notepad-plus-plus/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s