Page 1 of 1

Search and Insert

Posted: Mon Apr 20, 2015 9:15 pm
by msharpe
Hi Folks,

I'm trying to search for a line with a specific string and then insert a new line after.

Searching for a line containing G87* (the following characters change in each file)and insert M32 on the next line.

Examples:

G87P123
becomes
G87P123
M32

G870-45
becomes
G870-45
M32

looks like the wild card (*) doesn't work in the standard find/replace field.

Anybody got any ideas how to do this ?

Re: Search and Insert

Posted: Tue Apr 21, 2015 11:10 am
by DigitalVolcano
You can use regular expressions - Standard replace doesn't support wildcards.

RegEx:

Code: Select all

(G87.*$)
Replace:

Code: Select all

$1\r\nM32
Options:
Multi-line Anchors

Try it in the reg-ex tester. Remember to back up before replacing!