Page 1 of 1

Replace similar string in just part of a line

Posted: Wed Apr 13, 2016 2:19 am
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!

Re: Replace similar string in just part of a line

Posted: Wed Apr 13, 2016 6:29 pm
by Abacre
Go to batch replace tab.
check Use regular expressions
search for:
^(.+)\tND\t
replace with:
$1\tNEW DEPARTURE\t