Replace similar string in just part of a line

General discussions about Advanced Find and Replace
Post Reply
Easy Victor
Posts: 1
Joined: Wed Apr 13, 2016 1:45 am

Replace similar string in just part of a line

Post by Easy Victor »

Hoping you can assist with a find/replace problem I am having. I have a short string that I want to replace in a tab delimited line (actually 100,000 lines!). But this string appears in another part of the line also (which I don't want to replace). Here is an example:

CURRENT: -0123ABNDC-025 ND 4 b
REQUIRED: -0123ABNDC-025 NEW DEPARTURE 4 b

similar to above:

CURRENT: -0123ABCND-025ND ND 4 b
REQUIRED: -0123ABCND-025ND NEW DEPARTURE 4 B

Essentially, I want to replace the instance of "ND" ONLY after the 1st tab (it would only appear in the first 2 tabs in any case) with "NEW DEPARTURE".

How do I get AFR to only look for the find after the first tab?

Many thanks in advance!

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: Replace similar string in just part of a line

Post by Abacre »

Go to batch replace tab.
check Use regular expressions
search for:
^(.+)\tND\t
replace with:
$1\tNEW DEPARTURE\t
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply