Notepad++, Add Text at Start and End of Each Line, Remove Empty Lines, Replace all lines starting with …

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

Add Text at Start and End of Each Line

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.

Step 1: Open Your text in 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.

 

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.

 

Step 4: Result

 

Remove Empty Lines

  1. Go menu -> Edit -> Line operations
  2. Choose “Remove Empty Lines” or “Remove Empty Lines (Containing white spaces)” according to your needs.

 

Replace all lines starting with

Enter ^ the the text eg.^Ore\(DIAMOND_ORE.*

This will find all lines That start with ‘Ore\(Diamond_ORE.’ and any other character after that

The ^ character means match the beginning of a line and the .* means match any character any number of times.

For a single file you can use the simple search and replace feature.

Make sure the find and replace box has Regular Expressions checked and that . matches newline is not checked.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Other
Windows Run Commands Reference

Handy Reference for windows Run Commands To access just Windows Key + R               This will bring up the run command window             In this we type the commands. Commands are not case sensitive. Reference     Related

Other
Enable NetLogon Logging

To enable NetLogon Logging, use the following command on a domain controller: nltest /dbflag:0x2080ffff When finished, disable NetLogon Logging with this command: nltest /dbflag:0x0 The netlogon.log file is located in the %SystemRoot%\Debug directory of a Microsoft Windows Domain Controller. 0x2080ffff is the most verbose setting and shows detailed timestamps, the …