Sunday, November 18, 2012

How to add text to beginning or end of each line using notepad++

Get your text to modify in notepad++.

Step 1) Bring up the Find/Replace Dialog box by going to menu Search->Replace; or using shortcut CTRL+H.
Step 2) Select the "Regular expression" option in the "Search Mode" section of the dialog box.
Step 3) Enter "^" into the "Find what" textbox. ("^" denotes (matches) beginning of a line in Regular Expression syntax)
Step 4) In this example we will add "http://" to the beginning of each line. So enter "http://" (without double quotes) in the "Replace with" textbox.
Step 5) Press "Replace All" and your text will have "http://" at the beginning of each line.

Similar steps can be followed to add texts to the end of each line. Just use "$" instead of "^". In Regular Expression syntax, "$" matches the end of a line.


2 comments:

  1. Thanks a lot my friend.
    I can't imagine how much it help me.

    ReplyDelete
  2. I cannot add text like writeln(myfile,'
    I get writelnmyfile,' The ( is missing
    Same thing for the end of the line. I am trying to add '); and i only get '
    What can I do?
    Thanks,

    ReplyDelete