Inserting line before lines containing a particular word

Posted on

QUESTION :

How to insert a line before a line ending with a certain word in textpad? For eg: I want to insert a blank line before every line that ends with the word ‘Chapter’

ANSWER :

You need to make a use of regex-based search/replace functionality.
Search for

(.*Chapter)(rn)

Replace with

(rn)(1)(rn)

This will do exactly what you have asked: add a new line before every line that ends with the word Chapter. Note, this does not consider fullstop at the end of the sentence since you did not mention it.

Leave a Reply

Your email address will not be published.