Search and Insert

Tool for Search and Replace across multiple files.
Post Reply
msharpe
Posts: 2
Joined: Mon Apr 20, 2015 9:07 pm

Search and Insert

Post 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 ?
User avatar
DigitalVolcano
Site Admin
Posts: 1724
Joined: Thu Jun 09, 2011 10:04 am

Re: Search and Insert

Post 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!
Post Reply