Wednesday, 29 August 2012

Add Prefix or Suffix using Notepad++ 

 

Notepad++ is a great text document editor.

When a prefix or suffix need to be added to all lines in a text document, search and replace function of Notepad++ can be used.

Check out the image which shows how to do this.


In Find What enter "^(.+)$" without the quotes, in replace with column enter "<Prefix>\1" to add prefix or "\1<Suffix> to add suffix. Where <Prefix> and <Suffix> are the data you want to insert.

Also, make sure to keep the search mode in "Regular expression"

That should do the trick!!!

3 comments:

  1. In a very large text file I need to prefix every line with the text: PSCMD.EXE " (including the quote).
    Two weeks ago I did this successfully In ++Notepad by going to Search / Find / Replace and replacing every occurrence of ^(.+)$ as instructed.

    Today it does not work. Every line in the file finishes up with my prefix but all the existing data is gone.

    ReplyDelete