Page 1 of 1

Can I Replace lines of text?

Posted: Thu Oct 30, 2003 2:05 pm
by drslim
Is it possible to replace lines of text eg. how can I replace the 3 lines below with the new text ??

This is line 1 of old text.
This is line 2 of old text.
This is line 3 of old text.

(Below is the new text to replace the 3 lines of text above)
This is line 1 of NEW text.
This is line 2 of NEW text.
This is line 3 of NEW text.

Posted: Thu Oct 30, 2003 2:17 pm
by s_reynisson
Using Posix for regular expressions:
Find "This is line ([0-9]+) of old text."
Replace "This is line \1 of NEW text."
w/o the quotes.

Posted: Thu Oct 30, 2003 2:25 pm
by drslim
Sorry, I have made the example too simple.

How can I replace say...

This week payments are due.
Incomes have risen and this bonuses are due.

(replace it with)

Every cat & dog will get more food.
Tuna & shrimp to be weighed out.
Dinner is at 6 pm.

Posted: Thu Oct 30, 2003 2:36 pm
by s_reynisson
The linebreaks you're after? Use "\n".