Add a new text
I wonder if it is possoble to add a new line of codd below another line. Well, let me explain, I have a menu on 34 pages, built in HTML. I am adding another link on the menu and I do not want to open each page to add. So, I am wondering if we can search a specific line and then add a line after it without replacing the other line.
I am not replacing here but adding.
Yes, you would use a Regular expression replacement to do something like this. The general method is to match some text and then replace it with itself plus a line-ending plus the new line of text you want to add, plus another line-ending. I most cases, the line-ending will be represented by
\r\nin the replace box in Notepad++.
Here I have this code on my doc:
I wan to add this below it on all pages at once:
On Search tab, I chose Replace, then in Find field I select the whole first line and in Replace field I add the second line, with “\r\n” at the beginning. I chose Regular Expression as search type.
Result is, it is replacing the whole first line with the second line on a new line.
The very basics of it would be:
<a href="home.html">Home</a>\r\n<a href="travel.html">Travel</a>
Thank that’s works. But is there a way to indent the line as well like making it appear on the same line as the first one, with indentation?